apurtell commented on code in PR #2666:
URL: https://github.com/apache/phoenix/pull/2666#discussion_r4519427450
##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/UncoveredGlobalIndexRegionScannerIT.java:
##########
@@ -919,6 +919,41 @@ public void testPointLookup() throws Exception {
}
}
+ /**
+ * A row that gives NULL for the conditions on uncovered columns does not
change the result of the
+ * next rows in the same region scan.
+ */
+ @Test
+ public void testUncoveredConditionsAfterNullRow() throws Exception {
+ String dataTableName = generateUniqueName();
+ String indexTableName = generateUniqueName();
+ try (Connection conn = DriverManager.getConnection(getUrl());
+ Statement stmt = conn.createStatement()) {
+ stmt.execute("create table " + dataTableName
+ + " (id varchar(10) not null primary key, val1 varchar(10), val2
varchar(10),"
+ + " val3 varchar(10))" + (salted ? " SALT_BUCKETS=4" : ""));
+ // The first row in index order has a NULL val2. The other rows match
all conditions.
+ stmt.execute("upsert into " + dataTableName + " values ('a', 'x', null,
'z')");
+ for (char id = 'b'; id <= 'h'; id++) {
+ stmt.execute("upsert into " + dataTableName + " values ('" + id + "',
'x', 'y', 'z')");
+ }
+ conn.commit();
+ stmt.execute("CREATE " + (uncovered ? "UNCOVERED " : "") + "INDEX " +
indexTableName + " on "
+ + dataTableName + " (val1)");
+ String sql = "SELECT /*+ INDEX(" + dataTableName + " " + indexTableName
+ ")*/ id from "
+ + dataTableName + " WHERE val1 = 'x' AND val2 = 'y' AND val3 = 'z'";
+ assertTrue(TestUtil.getExplainPlan(conn, sql).contains(indexTableName));
+ int rows = 0;
+ try (ResultSet rs = stmt.executeQuery(sql)) {
Review Comment:
CREATE INDEX already marks the index ACTIVE synchronously.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]