Return-Path: X-Original-To: apmail-phoenix-commits-archive@minotaur.apache.org Delivered-To: apmail-phoenix-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E71E017648 for ; Fri, 7 Nov 2014 16:42:57 +0000 (UTC) Received: (qmail 6686 invoked by uid 500); 7 Nov 2014 16:42:57 -0000 Delivered-To: apmail-phoenix-commits-archive@phoenix.apache.org Received: (qmail 6645 invoked by uid 500); 7 Nov 2014 16:42:57 -0000 Mailing-List: contact commits-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list commits@phoenix.apache.org Received: (qmail 6636 invoked by uid 99); 7 Nov 2014 16:42:57 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2014 16:42:57 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 732F2989FA5; Fri, 7 Nov 2014 16:42:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jamestaylor@apache.org To: commits@phoenix.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: phoenix git commit: PHOENIX-1405 Problem referencing lower-case column names with Phoenix / Pig / Spark (Robert Roland) Date: Fri, 7 Nov 2014 16:42:57 +0000 (UTC) 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 Authored: Fri Nov 7 08:40:43 2014 -0800 Committer: James Taylor 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);