PHOENIX-3695 Remove testUnfoundSingleColumnCaseStatement from CaseStatementIT
Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/0ea5602f Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/0ea5602f Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/0ea5602f Branch: refs/heads/calcite Commit: 0ea5602f203dc8980125ae75f12989bd793fdf98 Parents: 07b32b9 Author: Samarth <samarth.j...@salesforce.com> Authored: Mon Feb 27 14:09:26 2017 -0800 Committer: Samarth <samarth.j...@salesforce.com> Committed: Mon Feb 27 14:09:26 2017 -0800 ---------------------------------------------------------------------- .../org/apache/phoenix/end2end/BaseQueryIT.java | 25 +++++++------- .../apache/phoenix/end2end/CaseStatementIT.java | 34 -------------------- 2 files changed, 12 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/0ea5602f/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java index e82daf9..9a58b5b 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/BaseQueryIT.java @@ -67,19 +67,18 @@ public abstract class BaseQueryIT extends BaseClientManagedTimeIT { protected static final long BATCH_SIZE = 3; protected static final String[] INDEX_DDLS = new String[] { "CREATE INDEX %s ON %s (a_integer DESC) INCLUDE (" - + " A_STRING, " + " B_STRING, " + " A_DATE)"}; -// , -// "CREATE INDEX %s ON %s (a_integer, a_string) INCLUDE (" -// + " B_STRING, " + " A_DATE)", -// "CREATE INDEX %s ON %s (a_integer) INCLUDE (" -// + " A_STRING, " + " B_STRING, " + " A_DATE)", -// "CREATE LOCAL INDEX %s ON %s (a_integer DESC) INCLUDE (" -// + " A_STRING, " + " B_STRING, " + " A_DATE)", -// "CREATE LOCAL INDEX %s ON %s (a_integer, a_string) INCLUDE (" + " B_STRING, " -// + " A_DATE)", -// "CREATE LOCAL INDEX %s ON %s (a_integer) INCLUDE (" -// + " A_STRING, " + " B_STRING, " + " A_DATE)", -// "" }; + + " A_STRING, " + " B_STRING, " + " A_DATE)", + "CREATE INDEX %s ON %s (a_integer, a_string) INCLUDE (" + + " B_STRING, " + " A_DATE)", + "CREATE INDEX %s ON %s (a_integer) INCLUDE (" + + " A_STRING, " + " B_STRING, " + " A_DATE)", + "CREATE LOCAL INDEX %s ON %s (a_integer DESC) INCLUDE (" + + " A_STRING, " + " B_STRING, " + " A_DATE)", + "CREATE LOCAL INDEX %s ON %s (a_integer, a_string) INCLUDE (" + " B_STRING, " + + " A_DATE)", + "CREATE LOCAL INDEX %s ON %s (a_integer) INCLUDE (" + + " A_STRING, " + " B_STRING, " + " A_DATE)", + "" }; @BeforeClass @Shadower(classBeingShadowed = BaseClientManagedTimeIT.class) http://git-wip-us.apache.org/repos/asf/phoenix/blob/0ea5602f/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java index d2b14a9..31b08db 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CaseStatementIT.java @@ -178,40 +178,6 @@ public class CaseStatementIT extends BaseQueryIT { } @Test - @Ignore // FIXME:PHOENIX-3695 - public void testUnfoundSingleColumnCaseStatement() throws Exception { - String query = "SELECT entity_id, b_string FROM " + tableName + " WHERE organization_id=? and CASE WHEN a_integer = 0 or a_integer != 0 THEN 1 ELSE 0 END = 0"; - String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5 - Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); - Connection conn = DriverManager.getConnection(url, props); - // Set ROW5.A_INTEGER to null so that we have one row - // where the else clause of the CASE statement will - // fire. - url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 1); // Run query at timestamp 5 - Connection upsertConn = DriverManager.getConnection(url, props); - String upsertStmt = - "upsert into " + tableName + - "(" + - " ENTITY_ID, " + - " ORGANIZATION_ID, " + - " A_INTEGER) " + - "VALUES ('" + ROW5 + "','" + tenantId + "', null)"; - upsertConn.setAutoCommit(true); // Test auto commit - // Insert all rows at ts - PreparedStatement stmt = upsertConn.prepareStatement(upsertStmt); - stmt.execute(); // should commit too - upsertConn.close(); - - PreparedStatement statement = conn.prepareStatement(query); - statement.setString(1, tenantId); - ResultSet rs = statement.executeQuery(); - assertTrue(rs.next()); - assertEquals(ROW5, rs.getString(1)); - assertFalse(rs.next()); - conn.close(); - } - - @Test public void testNonNullMultiCondCaseStatement() throws Exception { String query = "SELECT CASE WHEN entity_id = '000000000000000' THEN 1 WHEN entity_id = '000000000000001' THEN 2 ELSE 3 END FROM " + tableName + " WHERE organization_id=?"; String url = getUrl() + ";" + PhoenixRuntime.CURRENT_SCN_ATTRIB + "=" + (ts + 5); // Run query at timestamp 5