kfaraz commented on code in PR #19805:
URL: https://github.com/apache/druid/pull/19805#discussion_r3691616899
##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:
##########
@@ -305,24 +305,30 @@ public void createPendingSegmentsTable(final String
tableName)
+ " sequence_prev_id VARCHAR(255) NOT NULL,\n"
+ " sequence_name_prev_id_sha1 VARCHAR(255) NOT NULL,\n"
+ " payload %2$s NOT NULL,\n"
+ + " upgraded_from_segment_id VARCHAR(255),\n"
+ + " task_allocator_id VARCHAR(255),\n"
+ " PRIMARY KEY (id),\n"
+ " UNIQUE (sequence_name_prev_id_sha1)\n"
+ ")",
tableName, getPayloadType(), getQuoteString(), getCollation()
)
)
);
- createIndex(
+ createIndexIfNotExists(
tableName,
"IDX_%S_DATASOURCE_END",
List.of("dataSource", quoteColumn("end"))
);
- createIndex(
+ createIndexIfNotExists(
tableName,
"IDX_%S_DATASOURCE_SEQUENCE",
List.of("dataSource", "sequence_name")
);
- alterPendingSegmentsTable(tableName);
+ createIndexIfNotExists(
Review Comment:
Or maybe return a boolean indicating that the table has been freshly
created, and then use that to invoke alter to add columns and then finally
create the indexes. Let me check.
--
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]