FAQ
Author: hashutosh
Date: Wed Jan 14 17:55:15 2015
New Revision: 1651752

URL: http://svn.apache.org/r1651752
Log:
HIVE-9344 : Fix flaky test optimize_nullscan (Navis via Ashutosh Chauhan)

Modified:
     hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java?rev=1651752&r1=1651751&r2=1651752&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/NullScanTaskDispatcher.java Wed Jan 14 17:55:15 2015
@@ -21,6 +21,8 @@ package org.apache.hadoop.hive.ql.optimi
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
  import java.util.HashSet;
  import java.util.LinkedHashMap;
  import java.util.List;
@@ -58,9 +60,10 @@ import org.apache.hadoop.hive.serde2.Nul
   */
  public class NullScanTaskDispatcher implements Dispatcher {

- private final PhysicalContext physicalContext;
- private final Map<Rule, NodeProcessor> rules;
    static final Log LOG = LogFactory.getLog(NullScanTaskDispatcher.class.getName());
+
+ private final PhysicalContext physicalContext;
+ private final Map<Rule, NodeProcessor> rules;

    public NullScanTaskDispatcher(PhysicalContext context, Map<Rule, NodeProcessor> rules) {
      super();
@@ -91,18 +94,6 @@ public class NullScanTaskDispatcher impl
      return desc;
    }

- private List<String> getPathsForAlias(MapWork work, String alias) {
- List<String> paths = new ArrayList<String>();
-
- for (Map.Entry<String, ArrayList<String>> entry : work.getPathToAliases().entrySet()) {
- if (entry.getValue().contains(alias)) {
- paths.add(entry.getKey());
- }
- }
-
- return paths;
- }
-
    private void processAlias(MapWork work, String path, ArrayList<String> aliasesAffected,
        ArrayList<String> aliases) {
      // the aliases that are allowed to map to a null scan.
@@ -164,7 +155,15 @@ public class NullScanTaskDispatcher impl
      ParseContext parseContext = physicalContext.getParseContext();
      WalkerCtx walkerCtx = new WalkerCtx();

- for (MapWork mapWork: task.getMapWork()) {
+ List<MapWork> mapWorks = new ArrayList<MapWork>(task.getMapWork());
+ Collections.sort(mapWorks, new Comparator<MapWork>() {
+ @Override
+ public int compare(MapWork o1, MapWork o2) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ });
+
+ for (MapWork mapWork : mapWorks) {
        LOG.debug("Looking at: "+mapWork.getName());
        Collection<Operator<? extends OperatorDesc>> topOperators
          = mapWork.getAliasToWork().values();

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJan 14, '15 at 5:55p
activeJan 14, '15 at 5:55p
posts1
users1
websitehive.apache.org

1 user in discussion

Hashutosh: 1 post

People

Translate

site design / logo © 2021 Grokbase