palashc commented on code in PR #13:
URL: https://github.com/apache/phoenix-adapters/pull/13#discussion_r3606897510


##########
phoenix-ddb-rest/src/test/java/org/apache/phoenix/ddb/CreateTableIT.java:
##########
@@ -318,6 +323,53 @@ public void createTableWithStreamTest() throws Exception {
         TestUtils.validateCdcProps(url, tableName);
     }
 
+    @Test(timeout = 120000)
+    public void createTableWithStrongConsistencyTag() throws Exception {
+        final String tableName = testName.getMethodName().toUpperCase();
+        CreateTableRequest createTableRequest =
+                DDLTestUtils.getCreateTableRequest(tableName, "PK1", 
ScalarAttributeType.B, "PK2",
+                        ScalarAttributeType.S);
+        final String gsi = "IDX1_" + tableName;
+        final String lsi = "IDX2_" + tableName;
+        createTableRequest = DDLTestUtils.addIndexToRequest(true, 
createTableRequest, gsi, "COL1",
+                ScalarAttributeType.N, "COL2", ScalarAttributeType.B);
+        createTableRequest = DDLTestUtils.addIndexToRequest(false, 
createTableRequest, lsi, "PK1",
+                ScalarAttributeType.B, "LCOL2", ScalarAttributeType.S);
+        createTableRequest = createTableRequest.toBuilder().tags(Tag.builder()
+                
.key(ApiMetadata.TAG_INDEX_CONSISTENCY).value(ApiMetadata.INDEX_CONSISTENCY_STRONG)
+                .build()).build();
+
+        phoenixDBClientV2.createTable(createTableRequest);
+
+        assertIndexConsistency(tableName, gsi, IndexConsistency.STRONG);
+        assertIndexConsistency(tableName, lsi, IndexConsistency.STRONG);
+    }
+
+    @Test(timeout = 120000)
+    public void createTableDefaultsToEventualConsistency() throws Exception {
+        final String tableName = testName.getMethodName().toUpperCase();
+        CreateTableRequest createTableRequest =
+                DDLTestUtils.getCreateTableRequest(tableName, "PK1", 
ScalarAttributeType.B, "PK2",
+                        ScalarAttributeType.S);
+        final String gsi = "IDX1_" + tableName;
+        createTableRequest = DDLTestUtils.addIndexToRequest(true, 
createTableRequest, gsi, "COL1",
+                ScalarAttributeType.N, "COL2", ScalarAttributeType.B);
+
+        phoenixDBClientV2.createTable(createTableRequest);
+
+        assertIndexConsistency(tableName, gsi, IndexConsistency.EVENTUAL);

Review Comment:
   `createTableDefaultsToEventualConsistency` already covers the default case 
with no tags so we should be good. 



-- 
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]

Reply via email to