phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject phoenix git commit: PHOENIX-1405 Problem referencing lower-case column names with Phoenix / Pig / Spark (Robert Roland)
Date Fri, 07 Nov 2014 16:42:57 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.2 aff863112 -> c0fb05d3b


PHOENIX-1405 Problem referencing lower-case column names with Phoenix / Pig / Spark (Robert
Roland)


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

Branch: refs/heads/4.2
Commit: c0fb05d3b9ca0faf5cf2c0302cc2128087cbedc7
Parents: aff8631
Author: James Taylor <jtaylor@salesforce.com>
Authored: Fri Nov 7 08:40:43 2014 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Fri Nov 7 08:41:52 2014 -0800

----------------------------------------------------------------------
 .../java/org/apache/phoenix/util/PhoenixRuntime.java     | 11 ++++-------
 .../apache/phoenix/pig/PhoenixPigConfigurationIT.java    |  2 +-
 2 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/c0fb05d3/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java b/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java
index 36c5822..f7abe7e 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/PhoenixRuntime.java
@@ -34,14 +34,10 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
-import java.util.StringTokenizer;
 import java.util.TreeSet;
 
 import javax.annotation.Nullable;
 
-import com.google.common.base.Preconditions;
-import com.google.common.base.Splitter;
-import com.google.common.collect.ImmutableList;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.CommandLineParser;
 import org.apache.commons.cli.HelpFormatter;
@@ -78,6 +74,8 @@ import org.apache.phoenix.schema.RowKeySchema;
 import org.apache.phoenix.schema.TableNotFoundException;
 import org.apache.phoenix.schema.ValueBitSet;
 
+import com.google.common.base.Splitter;
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 
 /**
@@ -338,9 +336,9 @@ public class PhoenixRuntime {
                     ColumnInfo columnInfo = PhoenixRuntime.getColumnInfo(table, columnName);
                     columnInfoList.add(columnInfo);
                 } catch (ColumnNotFoundException cnfe) {
-                    unresolvedColumnNames.add(columnName.trim());
+                    unresolvedColumnNames.add(columnName);
                 } catch (AmbiguousColumnException ace) {
-                    unresolvedColumnNames.add(columnName.trim());
+                    unresolvedColumnNames.add(columnName);
                 }
             }
         }
@@ -381,7 +379,6 @@ public class PhoenixRuntime {
         if (columnName==null) {
             throw new SQLException("columnName must not be null.");
         }
-        columnName = columnName.trim().toUpperCase();
         PColumn pColumn = null;
         if (columnName.contains(QueryConstants.NAME_SEPARATOR)) {
             String[] tokens = columnName.split(QueryConstants.NAME_SEPARATOR_REGEX);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/c0fb05d3/phoenix-pig/src/it/java/org/apache/phoenix/pig/PhoenixPigConfigurationIT.java
----------------------------------------------------------------------
diff --git a/phoenix-pig/src/it/java/org/apache/phoenix/pig/PhoenixPigConfigurationIT.java
b/phoenix-pig/src/it/java/org/apache/phoenix/pig/PhoenixPigConfigurationIT.java
index d35e039..a6f6efd 100644
--- a/phoenix-pig/src/it/java/org/apache/phoenix/pig/PhoenixPigConfigurationIT.java
+++ b/phoenix-pig/src/it/java/org/apache/phoenix/pig/PhoenixPigConfigurationIT.java
@@ -93,7 +93,7 @@ public class PhoenixPigConfigurationIT extends BaseHBaseManagedTimeIT {
                     "  CONSTRAINT pk PRIMARY KEY (a_string, a_binary))\n";
             createTestTable(getUrl(), ddl);
             final PhoenixPigConfiguration configuration = newConfiguration (tableName);
-            configuration.setSelectColumns("a_binary");
+            configuration.setSelectColumns("A_BINARY");
             final String selectStatement = configuration.getSelectStatement();
             final String expectedSelectStatement = "SELECT \"A_BINARY\" FROM " + SchemaUtil.getEscapedArgument(tableName)
; 
             assertEquals(expectedSelectStatement, selectStatement);


Mime
View raw message