Repository: hive
Updated Branches:
  refs/heads/master 2e35bac54 -> 299672cfc


HIVE-14060: Hive: Remove bogus localhost from Hive splits (Gopal V, reviewed by 
Sergey Shelukhin)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/299672cf
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/299672cf
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/299672cf

Branch: refs/heads/master
Commit: 299672cfc784445048c5145f273a917862c62f5d
Parents: 2e35bac
Author: Gopal V <[email protected]>
Authored: Tue Jun 21 16:37:36 2016 -0700
Committer: Gopal V <[email protected]>
Committed: Tue Jun 21 16:37:36 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/exec/tez/Utils.java | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/299672cf/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java
index 3eb858b..8a4fc08 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/Utils.java
@@ -20,10 +20,12 @@ package org.apache.hadoop.hive.ql.exec.tez;
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.llap.registry.ServiceInstance;
 import org.apache.hadoop.hive.llap.registry.impl.LlapRegistryService;
+import org.apache.hadoop.mapred.InputSplit;
 import org.apache.hadoop.mapred.split.SplitLocationProvider;
 import org.slf4j.Logger;
 
@@ -51,7 +53,21 @@ public class Utils {
       }
       splitLocationProvider = new HostAffinitySplitLocationProvider(locations);
     } else {
-      splitLocationProvider = null;
+      splitLocationProvider = new SplitLocationProvider() {
+        @Override
+        public String[] getLocations(InputSplit split) throws IOException {
+          if (split == null) {
+            return null;
+          }
+          String[] locations = split.getLocations();
+          if (locations != null && locations.length == 1) {
+            if ("localhost".equals(locations[0])) {
+              return ArrayUtils.EMPTY_STRING_ARRAY;
+            }
+          }
+          return locations;
+        }
+      };
     }
     return splitLocationProvider;
   }

Reply via email to