hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prasan...@apache.org
Subject hive git commit: HIVE-11035: PPD: Orc Split elimination fails because filterColumns=[-1] (Prasanth Jayachandran reviewed by Gopal V)
Date Thu, 18 Jun 2015 06:44:27 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1.2 8ee9714c7 -> 749bbfcf6


HIVE-11035: PPD: Orc Split elimination fails because filterColumns=[-1] (Prasanth Jayachandran
reviewed by Gopal V)


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

Branch: refs/heads/branch-1.2
Commit: 749bbfcf6a2b3a284553f2ee2168039335241438
Parents: 8ee9714
Author: Prasanth Jayachandran <j.prasanth.j@gmail.com>
Authored: Wed Jun 17 23:43:55 2015 -0700
Committer: Prasanth Jayachandran <j.prasanth.j@gmail.com>
Committed: Wed Jun 17 23:43:55 2015 -0700

----------------------------------------------------------------------
 .../hive/serde2/ColumnProjectionUtils.java      | 29 +++-----------------
 1 file changed, 4 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/749bbfcf/serde/src/java/org/apache/hadoop/hive/serde2/ColumnProjectionUtils.java
----------------------------------------------------------------------
diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/ColumnProjectionUtils.java b/serde/src/java/org/apache/hadoop/hive/serde2/ColumnProjectionUtils.java
index 08a4e99..10086c5 100644
--- a/serde/src/java/org/apache/hadoop/hive/serde2/ColumnProjectionUtils.java
+++ b/serde/src/java/org/apache/hadoop/hive/serde2/ColumnProjectionUtils.java
@@ -25,6 +25,7 @@ import java.util.List;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.util.StringUtils;
 
+import com.google.common.base.Joiner;
 import com.google.common.collect.Lists;
 
 /**
@@ -38,6 +39,7 @@ public final class ColumnProjectionUtils {
   public static final String READ_COLUMN_NAMES_CONF_STR = "hive.io.file.readcolumn.names";
   private static final String READ_COLUMN_IDS_CONF_STR_DEFAULT = "";
   private static final boolean READ_ALL_COLUMNS_DEFAULT = true;
+  private static final Joiner CSV_JOINER = Joiner.on(",").skipNulls();
 
   /**
    * @deprecated for backwards compatibility with <= 0.12, use setReadAllColumns
@@ -109,31 +111,8 @@ public final class ColumnProjectionUtils {
   public static void appendReadColumns(
       StringBuilder readColumnsBuffer, StringBuilder readColumnNamesBuffer, List<Integer>
ids,
       List<String> names) {
-    appendReadColumns(readColumnsBuffer, ids);
-    appendReadColumnNames(readColumnNamesBuffer, names);
-  }
-
-  public static void appendReadColumns(StringBuilder readColumnsBuffer, List<Integer>
ids) {
-    String id = toReadColumnIDString(ids);
-    String newConfStr = id;
-    if (readColumnsBuffer.length() > 0) {
-      readColumnsBuffer.append(StringUtils.COMMA_STR).append(newConfStr);
-    }
-    if (readColumnsBuffer.length() == 0) {
-      readColumnsBuffer.append(READ_COLUMN_IDS_CONF_STR_DEFAULT);
-    }
-  }
-
-  private static void appendReadColumnNames(StringBuilder readColumnNamesBuffer, List<String>
cols) {
-    boolean first = readColumnNamesBuffer.length() > 0;
-    for(String col: cols) {
-      if (first) {
-        first = false;
-      } else {
-        readColumnNamesBuffer.append(',');
-      }
-      readColumnNamesBuffer.append(col);
-    }
+    CSV_JOINER.appendTo(readColumnsBuffer, ids);
+    CSV_JOINER.appendTo(readColumnNamesBuffer, names);
   }
 
   /**


Mime
View raw message