dbwong commented on a change in pull request #736: PHOENIX-5698 Phoenix Query
with RVC IN list expression generates wron…
URL: https://github.com/apache/phoenix/pull/736#discussion_r396235113
##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/InListIT.java
##########
@@ -586,4 +601,930 @@ public void testInListExpressionWithDesc() throws
Exception {
}
}
+ private void buildSchema(String fullTableName, String fullViewName,
boolean isDecOrder) throws Exception {
+ try (Connection conn = DriverManager.getConnection(getUrl())) {
+ conn.setAutoCommit(true);
+ try (Statement stmt = conn.createStatement()) {
+ stmt.execute("CREATE TABLE " + fullTableName + "(\n" + "
TENANT_ID CHAR(15) NOT NULL,\n" + " KEY_PREFIX CHAR(3) NOT NULL, ID5 BIGINT \n"
+
+ " CONSTRAINT PK PRIMARY KEY (\n" + " TENANT_ID," + "
KEY_PREFIX" + ")) MULTI_TENANT=TRUE");
+ if (isDecOrder) {
+ stmt.execute("CREATE VIEW " + fullViewName + "(\n" + " ID1
VARCHAR NOT NULL,\n" + " ID2 VARCHAR NOT NULL,\n" + " ID3 BIGINT, ID4 BIGINT
\n" +
+ " CONSTRAINT PKVIEW PRIMARY KEY\n" + " (\n" + "
ID1, ID2 DESC\n" + ")) " +
+ "AS SELECT * FROM " + fullTableName + " WHERE
KEY_PREFIX = '0CY'");
+ try (Connection viewConn =
DriverManager.getConnection(TENANT_SPECIFIC_URL1)) {
+ viewConn.setAutoCommit(true);
+ try (Statement tenantStmt =
viewConn.createStatement()) {
+ tenantStmt.execute("CREATE VIEW IF NOT EXISTS " +
this.descViewName + " AS SELECT * FROM " + fullViewName);
+ }
+ }
+ } else {
+ stmt.execute("CREATE VIEW " + fullViewName + "(\n" + " ID1
VARCHAR NOT NULL,\n" + " ID2 VARCHAR NOT NULL,\n" + " ID3 BIGINT, ID4 BIGINT
\n" +
+ " CONSTRAINT PKVIEW PRIMARY KEY\n" + " (ID1, ID2))
" +
+ "AS SELECT * FROM " + fullTableName + " WHERE
KEY_PREFIX = '0CY'");
+ try (Connection viewConn =
DriverManager.getConnection(TENANT_SPECIFIC_URL1)) {
+ viewConn.setAutoCommit(true);
+ try (Statement tenantStmt =
viewConn.createStatement()) {
+ tenantStmt.execute("CREATE VIEW IF NOT EXISTS " +
this.ascViewName + " AS SELECT * FROM " + fullViewName);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ public void testInListExpressionWithDescOrderWithRightQueryPlan1() throws
Exception {
Review comment:
nit rename test based on query plan you are expecting/scenario
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services