You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ja...@apache.org on 2014/11/07 17:40:54 UTC
phoenix git commit: PHOENIX-1405 Problem referencing lower-case
column names with Phoenix / Pig / Spark (Robert Roland)
Repository: phoenix
Updated Branches:
refs/heads/4.0 ece26a013 -> 97b8bc684
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/97b8bc68
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/97b8bc68
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/97b8bc68
Branch: refs/heads/4.0
Commit: 97b8bc684e828b1fd0939e7b3fa902547d117688
Parents: ece26a0
Author: James Taylor <jt...@salesforce.com>
Authored: Fri Nov 7 08:40:43 2014 -0800
Committer: James Taylor <jt...@salesforce.com>
Committed: Fri Nov 7 08:40:43 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/97b8bc68/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/97b8bc68/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);