AMashenkov commented on code in PR #2485:
URL: https://github.com/apache/ignite-3/pull/2485#discussion_r1302929989
##########
modules/catalog/src/testFixtures/java/org/apache/ignite/internal/catalog/BaseCatalogManagerTest.java:
##########
@@ -81,4 +91,66 @@ public void tearDown() throws Exception {
.map(component -> component::stop)
);
}
+
+ protected static CreateHashIndexParams createHashIndexParams(
+ String indexName,
+ boolean uniq,
+ @Nullable List<String> indexColumns
+ ) {
+ CreateHashIndexParams.Builder builder = CreateHashIndexParams.builder()
+ .schemaName(DEFAULT_SCHEMA_NAME)
+ .tableName(TABLE_NAME)
+ .indexName(indexName);
+
+ if (uniq) {
+ builder.unique();
+ }
+
+ if (indexColumns != null) {
+ builder.columns(indexColumns);
+ }
+
+ return builder.build();
+ }
+
+ protected static CreateHashIndexParams createHashIndexParams(
+ String indexName,
+ @Nullable List<String> indexColumns
+ ) {
+ return createHashIndexParams(indexName, false, indexColumns);
+ }
+
+ protected static CreateSortedIndexParams createSortedIndexParams(
+ String indexName,
+ boolean uniq,
+ @Nullable List<String> indexColumns,
+ @Nullable List<CatalogColumnCollation> columnsCollations
+ ) {
+ CreateSortedIndexParams.Builder builder =
CreateSortedIndexParams.builder()
+ .schemaName(DEFAULT_SCHEMA_NAME)
+ .tableName(TABLE_NAME)
+ .indexName(indexName);
+
+ if (uniq) {
+ builder.unique();
+ }
Review Comment:
`unique()` might accept the argument to avoid unwanted `if`
--
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]