[ https://issues.apache.org/jira/browse/PHOENIX-5698?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17063035#comment-17063035 ]
Hadoop QA commented on PHOENIX-5698: ------------------------------------ {color:red}-1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12997169/PHOENIX-5698-4.x.v4.patch against 4.x branch at commit 264715133cdb8085b48a79eddfe3d27736614715. ATTACHMENT ID: 12997169 {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 19 new or modified tests. {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:red}-1 release audit{color}. The applied patch generated 1 release audit warnings (more than the master's current 0 warnings). {color:red}-1 lineLengths{color}. The patch introduces the following lines longer than 100: + private static final String TENANT_SPECIFIC_URL1 = getUrl() + ';' + TENANT_ID_ATTRIB + "=tenant1"; + String tableName = generateUniqueName() + "in_test" + pkType.getSqlTypeName() + saltBuckets + (isMultiTenant ? "_multi" : "_single"); + private void buildSchema(String fullTableName, String fullViewName, boolean isDecOrder) throws Exception { + 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"); + 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" + ")) " + + tenantStmt.execute("CREATE VIEW IF NOT EXISTS " + this.descViewName + " AS SELECT * FROM " + fullViewName); + stmt.execute("CREATE VIEW " + fullViewName + "(\n" + " ID1 VARCHAR NOT NULL,\n" + " ID2 VARCHAR NOT NULL,\n" + " ID3 BIGINT, ID4 BIGINT \n" + + tenantStmt.execute("CREATE VIEW IF NOT EXISTS " + this.ascViewName + " AS SELECT * FROM " + fullViewName); {color:green}+1 core tests{color}. The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-PHOENIX-Build/3616//testReport/ Release audit warnings: https://builds.apache.org/job/PreCommit-PHOENIX-Build/3616//artifact/patchprocess/patchReleaseAuditWarnings.txt Console output: https://builds.apache.org/job/PreCommit-PHOENIX-Build/3616//console This message is automatically generated. > Phoenix Query with RVC IN list expression generates wrong scan with non-pk > ordered pks > -------------------------------------------------------------------------------------- > > Key: PHOENIX-5698 > URL: https://issues.apache.org/jira/browse/PHOENIX-5698 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.15.0, 4.14.3 > Reporter: Daniel Wong > Assignee: Xinyi Yan > Priority: Major > Labels: DESC > Attachments: PHOENIX-5698-4.14-HBase-1.3.patch, > PHOENIX-5698-4.x-HBase-1.3.patch, PHOENIX-5698-4.x.patch, > PHOENIX-5698-4.x.v3.patch, PHOENIX-5698-4.x.v4.patch, > PHOENIX-5698-master.v2.patch, PHOENIX-5698.patch > > Time Spent: 5h 20m > Remaining Estimate: 0h > > In the code below ideally we'd expect a SINGLE ROW DELETE plan client side. > However, this generates an incorrect scan with range ['tenant1 > 0CY005xx000001Sv6o'). If the order of the RVCs is changed to row key order > Phoenix correctly generates a SINGLE ROW SCAN. As we provide the full PK > this we expect a either tightly bounded range scan or a client side delete. > Instead we get a range scan on composite leading edge > TENANT_ID,KEY_PREFIX,ID1. > > {code:java} > @Test > public void testInListExpressionWithDescAgain() throws Exception { > String fullTableName = generateUniqueName(); > String fullViewName = generateUniqueName(); > String tenantView = generateUniqueName(); > // create base table and global view using global connection > try (Connection conn = DriverManager.getConnection(getUrl())) > { conn.setAutoCommit(true); Statement stmt = conn.createStatement(); > stmt.execute("CREATE TABLE " + fullTableName + "(\n" + " TENANT_ID CHAR(15) > NOT NULL,\n" + " KEY_PREFIX CHAR(3) NOT NULL,\n" + " CONSTRAINT PK PRIMARY > KEY (\n" + " TENANT_ID," + " KEY_PREFIX" + ")) MULTI_TENANT=TRUE"); > stmt.execute("CREATE VIEW " + fullViewName + "(\n" + " ID1 VARCHAR NOT > NULL,\n" + " ID2 VARCHAR NOT NULL,\n" + " EVENT_DATE DATE NOT NULL,\n" + " > CONSTRAINT PKVIEW PRIMARY KEY\n" + " (\n" + " ID1, ID2 DESC, EVENT_DATE > DESC\n" + ")) AS SELECT * FROM " + fullTableName + " WHERE KEY_PREFIX = > '0CY'"); } > // create and use a tenant specific view to write data > try (Connection viewConn = DriverManager.getConnection(TENANT_SPECIFIC_URL1) > ) { > viewConn.setAutoCommit(true); //need autocommit for serverside deletion > Statement stmt = viewConn.createStatement(); > stmt.execute("CREATE VIEW IF NOT EXISTS " + tenantView + " AS SELECT * FROM > " + fullViewName ); > viewConn.createStatement().execute("UPSERT INTO " + tenantView + "(ID1, ID2, > EVENT_DATE) VALUES ('005xx000001Sv6o', '000000000000300', 1532458230000)"); > viewConn.createStatement().execute("UPSERT INTO " + tenantView + "(ID1, ID2, > EVENT_DATE) VALUES ('005xx000001Sv6o', '000000000000400', 1532458240000)"); > viewConn.createStatement().execute("UPSERT INTO " + tenantView + "(ID1, ID2, > EVENT_DATE) VALUES ('005xx000001Sv6o', '000000000000500', 1532458250000)"); > viewConn.commit(); > ResultSet rs = stmt.executeQuery("SELECT ID1, ID2, EVENT_DATE FROM " + > tenantView ); > printResultSet(rs); > System.out.println("Delete Start"); > rs = stmt.executeQuery("EXPLAIN DELETE FROM " + tenantView + " WHERE (ID1, > EVENT_DATE, ID2) IN (('005xx000001Sv6o', 1532458240000, > '000000000000400'),('005xx000001Sv6o', 1532458230000, '000000000000300'))"); > printResultSet(rs); // THIS SHOULD BE A SINGLE ROW SCAN > stmt.execute("DELETE FROM " + tenantView + " WHERE (ID1, EVENT_DATE, ID2) IN > (('005xx000001Sv6o', 1532458240000, '000000000000400'),('005xx000001Sv6o', > 1532458230000, '000000000000300'))"); > viewConn.commit(); > System.out.println("Delete End"); > rs = stmt.executeQuery("SELECT ID1, ID2, EVENT_DATE FROM " + tenantView ); > printResultSet(rs); > } > } > private void printResultSet(ResultSet rs) throws SQLException { > StringBuilder builder = new StringBuilder(); > while(rs.next()) { > for(int i = 0; i < rs.getMetaData().getColumnCount(); i++) { > Object col = rs.getObject(i + 1); > if(col == null) > { builder.append("null"); } > else { > if(col instanceof Date) > { DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); > builder.append(df.format(col)); } > else { > builder.append(col.toString()); > } > } > builder.append(","); > } > builder.append("\n"); > } > System.out.println(builder.toString()); > } > {code} > -- This message was sent by Atlassian Jira (v8.3.4#803005)