jtuglu1 commented on code in PR #18515:
URL: https://github.com/apache/druid/pull/18515#discussion_r2377878833


##########
server/src/test/java/org/apache/druid/metadata/SQLMetadataConnectorTest.java:
##########
@@ -305,6 +307,170 @@ public void testIsTransientException()
     );
   }
 
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void test_tableIndices_areNotReplaced_ifExist(boolean 
useUniqueIndexName)
+  {
+    tablesConfig = new MetadataStorageTablesConfig(
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        useUniqueIndexName
+    );
+    connector = new TestDerbyConnector(new MetadataStorageConnectorConfig(), 
tablesConfig);
+
+    final String segmentsTable = tablesConfig.getSegmentsTable();
+    final List<String> legacyIndexTemplates = Arrays.asList(
+        "idx_%1$s_used",
+        "idx_%1$s_datasource_used_end_start",
+        "idx_%1$s_datasource_upgraded_from_segment_id"
+    );
+    final List<List<String>> indexColumns = List.of(
+        List.of("used"),
+        List.of(
+            "dataSource",
+            "used",
+            StringUtils.format("%send%S", connector.getQuoteString(), 
connector.getQuoteString()),

Review Comment:
   Normally this will capitalize the string – it doesn't matter in this case as 
all supported engines' quotations don't contain any alphabetical chars, so I 
left it as-is to reduce diff.



##########
server/src/test/java/org/apache/druid/metadata/SQLMetadataConnectorTest.java:
##########
@@ -305,6 +307,170 @@ public void testIsTransientException()
     );
   }
 
+  @ParameterizedTest
+  @ValueSource(booleans = {true, false})
+  public void test_tableIndices_areNotReplaced_ifExist(boolean 
useUniqueIndexName)
+  {
+    tablesConfig = new MetadataStorageTablesConfig(
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        null,
+        useUniqueIndexName
+    );
+    connector = new TestDerbyConnector(new MetadataStorageConnectorConfig(), 
tablesConfig);
+
+    final String segmentsTable = tablesConfig.getSegmentsTable();
+    final List<String> legacyIndexTemplates = Arrays.asList(
+        "idx_%1$s_used",
+        "idx_%1$s_datasource_used_end_start",
+        "idx_%1$s_datasource_upgraded_from_segment_id"
+    );
+    final List<List<String>> indexColumns = List.of(
+        List.of("used"),
+        List.of(
+            "dataSource",
+            "used",
+            StringUtils.format("%send%S", connector.getQuoteString(), 
connector.getQuoteString()),

Review Comment:
   Normally this will capitalize the provided string – it doesn't matter in 
this case as all supported engines' quotations don't contain any alphabetical 
chars, so I left it as-is to reduce diff.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to