gjacoby126 commented on a change in pull request #978: URL: https://github.com/apache/phoenix/pull/978#discussion_r529047017
########## File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/DeleteIT.java ########## @@ -943,6 +960,164 @@ public void testDeleteFilterWithMultipleIndexes() throws Exception { } } } -} + /* + Tests whether we have cell tags in delete marker for + ClientSelectDeleteMutationPlan. + */ + @Test + public void testDeleteClientDeleteMutationPlan() throws Exception { + String tableName = generateUniqueName(); + String indexName = generateUniqueName(); + String tagValue = "customer-delete"; + String delete = "DELETE FROM " + tableName + " WHERE v1 = 'foo'"; + Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); + // Add tag "customer-delete" to delete marker. + props.setProperty(ConnectionQueryServices.SOURCE_OPERATION_ATTRIB, tagValue); + + createAndUpsertTable(tableName, indexName, props); + // Make sure that the plan creates is of ClientSelectDeleteMutationPlan + verifyDeletePlan(delete, "ClientSelectDeleteMutationPlan", props); + executeDelete(delete, props, 1); + String startRowKeyForBaseTable = "1"; + String startRowKeyForIndexTable = "foo"; + // Make sure that Delete Marker has cell tag for base table + // and has no cell tag for index table. + checkTagPresentInDeleteMarker(tableName, startRowKeyForBaseTable, true, tagValue); + checkTagPresentInDeleteMarker(indexName, startRowKeyForIndexTable, false, null); + } + + /* + Tests whether we have cell tags in delete marker for + ServerSelectDeleteMutationPlan. + */ + @Test + public void testDeleteServerDeleteMutationPlan() throws Exception { + String tableName = generateUniqueName(); + String indexName = generateUniqueName(); + String tagValue = "customer-delete"; + String delete = "DELETE FROM " + tableName; + Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES); + props.setProperty(ConnectionQueryServices.SOURCE_OPERATION_ATTRIB, tagValue); + + createAndUpsertTable(tableName, indexName, props); + // Make sure that the plan creates is of ServerSelectDeleteMutationPlan + verifyDeletePlan(delete, "ServerSelectDeleteMutationPlan", props); Review comment: (If package level wouldn't, I think I'd rather they be public than have the strings hard-coded, so that the dependency is explicit) ---------------------------------------------------------------- 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: us...@infra.apache.org