You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ss...@apache.org on 2017/03/02 20:55:32 UTC
[3/3] 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/966b13bd
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/966b13bd
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/966b13bd
Branch: refs/heads/4.x-HBase-1.3
Commit: 966b13bd0ae4eb670360ce0c8ae4501f2d61fa4a
Parents: 4b5291d
Author: Sergey Soldatov <ss...@apache.org>
Authored: Wed Mar 1 15:41:49 2017 -0800
Committer: Sergey Soldatov <ss...@apache.org>
Committed: Thu Mar 2 12:54:08 2017 -0800
----------------------------------------------------------------------
.../hive/query/PhoenixQueryBuilderTest.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/phoenix/blob/966b13bd/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));
}
}