gokceni commented on a change in pull request #993:
URL: https://github.com/apache/phoenix/pull/993#discussion_r535778228
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/SingleCellIndexIT.java
##########
@@ -303,6 +303,37 @@ public void testTenantViewIndexes() throws Exception {
}
}
+ @Test
+ public void testUpsertSelect() throws Exception {
+ String tableName = generateUniqueName();
+ String idxName = "IDX_" + generateUniqueName();
+
+ try (Connection conn = DriverManager.getConnection(getUrl(),
testProps)) {
+ conn.setAutoCommit(true);
+ createTableAndIndex(conn, tableName, idxName, null, true, 2);
+ assertMetadata(conn, ONE_CELL_PER_COLUMN, NON_ENCODED_QUALIFIERS,
tableName);
+ assertMetadata(conn, SINGLE_CELL_ARRAY_WITH_OFFSETS,
TWO_BYTE_QUALIFIERS, idxName);
+
+ // this delete will be issued at a timestamp later than the above
timestamp of the index table
+ conn.createStatement().execute("delete from " + tableName + "
where pk1 = 'PK1'");
+ conn.commit();
+ String
+ sql =
+ "UPSERT /*+ NO_INDEX */ INTO " + idxName +
"(\":PK1\",\":INT_PK\",\"0:V1\",\"0:V2\",\"0:V4\") SELECT /*+ NO_INDEX */
PK1,INT_PK, V1, V2,V4 FROM "
Review comment:
I copy pasted this from PostIndexDDLCompilerTest. I think it is valid
but not mean much since this is already the index. Let me remove it
----------------------------------------------------------------
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]