You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ma...@apache.org on 2017/03/16 21:11:52 UTC

[30/50] [abbrv] phoenix git commit: Fixed UT for PHOENIX-3346 Hive PhoenixStorageHandler doesn't work well with column

Fixed UT for PHOENIX-3346 Hive PhoenixStorageHandler doesn't work well with column


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

Branch: refs/heads/calcite
Commit: 9ba564bbd972284554ceec18e34016ac458997b2
Parents: 1e2a967
Author: Sergey Soldatov <ss...@apache.org>
Authored: Wed Mar 1 15:41:49 2017 -0800
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Wed Mar 1 16:02:38 2017 -0800

----------------------------------------------------------------------
 .../hive/query/PhoenixQueryBuilderTest.java       | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/9ba564bb/phoenix-hive/src/test/java/org/apache/phoenix/hive/query/PhoenixQueryBuilderTest.java
----------------------------------------------------------------------
diff --git a/phoenix-hive/src/test/java/org/apache/phoenix/hive/query/PhoenixQueryBuilderTest.java b/phoenix-hive/src/test/java/org/apache/phoenix/hive/query/PhoenixQueryBuilderTest.java
index e4f872e..bc2cbe3 100644
--- a/phoenix-hive/src/test/java/org/apache/phoenix/hive/query/PhoenixQueryBuilderTest.java
+++ b/phoenix-hive/src/test/java/org/apache/phoenix/hive/query/PhoenixQueryBuilderTest.java
@@ -102,7 +102,7 @@ public class PhoenixQueryBuilderTest {
                         new Object[]{"CHAR1", "CHAR2", "CHAR3"}, COLUMN_CHAR, "char(10)", true)
         );
 
-        assertEquals(expectedQueryPrefix + "Column_Char not in ('CHAR1', 'CHAR2', 'CHAR3')",
+        assertEquals(expectedQueryPrefix + "\"Column_Char\" not in ('CHAR1', 'CHAR2', 'CHAR3')",
                 BUILDER.buildQuery(jobConf, TABLE_NAME, readColumnList, searchConditions));
 
         searchConditions = Lists.newArrayList(
@@ -118,7 +118,7 @@ public class PhoenixQueryBuilderTest {
                         new Object[]{"CHAR1", "CHAR2"}, COLUMN_CHAR, "char(10)", true)
         );
 
-        assertEquals(expectedQueryPrefix + "Column_Char not between 'CHAR1' and 'CHAR2'",
+        assertEquals(expectedQueryPrefix + "\"Column_Char\" not between 'CHAR1' and 'CHAR2'",
                 BUILDER.buildQuery(jobConf, TABLE_NAME, readColumnList, searchConditions));
     }
 
@@ -126,8 +126,8 @@ public class PhoenixQueryBuilderTest {
     public void testBuildBetweenQueryWithDateColumns() throws IOException {
         final String COLUMN_DATE = "Column_Date";
         final String tableName = "TEST_TABLE";
-        final String expectedQueryPrefix = "select /*+ NO_CACHE  */ " + COLUMN_DATE +
-                " from " + tableName + " where ";
+        final String expectedQueryPrefix = "select /*+ NO_CACHE  */ \"" + COLUMN_DATE +
+                "\" from " + tableName + " where ";
 
         JobConf jobConf = new JobConf();
         List<String> readColumnList = Lists.newArrayList(COLUMN_DATE);
@@ -138,7 +138,7 @@ public class PhoenixQueryBuilderTest {
         );
 
         assertEquals(expectedQueryPrefix +
-                        COLUMN_DATE + " between to_date('1992-01-02') and to_date('1992-02-02')",
+                        "\"" + COLUMN_DATE + "\" between to_date('1992-01-02') and to_date('1992-02-02')",
                 BUILDER.buildQuery(jobConf, TABLE_NAME, readColumnList, searchConditions));
 
         searchConditions = Lists.newArrayList(
@@ -147,7 +147,7 @@ public class PhoenixQueryBuilderTest {
         );
 
         assertEquals(expectedQueryPrefix +
-                        COLUMN_DATE + " not between to_date('1992-01-02') and to_date('1992-02-02')",
+                        "\"" + COLUMN_DATE + "\" not between to_date('1992-01-02') and to_date('1992-02-02')",
                 BUILDER.buildQuery(jobConf, TABLE_NAME, readColumnList, searchConditions));
     }
 
@@ -155,8 +155,8 @@ public class PhoenixQueryBuilderTest {
     public void testBuildQueryWithNotNull() throws IOException {
         final String COLUMN_DATE = "Column_Date";
         final String tableName = "TEST_TABLE";
-        final String expectedQueryPrefix = "select /*+ NO_CACHE  */ " + COLUMN_DATE +
-                " from " + tableName + " where ";
+        final String expectedQueryPrefix = "select /*+ NO_CACHE  */ \"" + COLUMN_DATE +
+                "\" from " + tableName + " where ";
 
         JobConf jobConf = new JobConf();
         List<String> readColumnList = Lists.newArrayList(COLUMN_DATE);
@@ -167,7 +167,7 @@ public class PhoenixQueryBuilderTest {
         );
 
         assertEquals(expectedQueryPrefix +
-                        COLUMN_DATE + " is not null ",
+                        "\"" + COLUMN_DATE + "\" is not null ",
                 BUILDER.buildQuery(jobConf, TABLE_NAME, readColumnList, searchConditions));
     }
 }