AmatyaAvadhanula commented on code in PR #16667:
URL: https://github.com/apache/druid/pull/16667#discussion_r1671724722
##########
server/src/main/java/org/apache/druid/metadata/SQLMetadataConnector.java:
##########
@@ -587,6 +587,11 @@ protected void alterSegmentTable()
Map<String, String> columnNameTypes = new HashMap<>();
columnNameTypes.put("used_status_last_updated", "VARCHAR(255)");
+ // upgraded_from_segment_id is the first segment to which the same load
spec originally belonged
+ // Load specs can be shared as a result of segment version upgrade
+ // This column is null for segments that haven't been upgraded.
Review Comment:
Done
##########
server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:
##########
@@ -286,7 +286,7 @@ private List<DataSegmentPlus> retrieveSegmentBatchById(
if (includeSchemaInfo) {
final Query<Map<String, Object>> query = handle.createQuery(
StringUtils.format(
- "SELECT payload, used, schema_fingerprint, num_rows FROM %s
WHERE dataSource = :dataSource %s",
+ "SELECT payload, used, upgraded_from_segment_id,
schema_fingerprint, num_rows FROM %s WHERE dataSource = :dataSource %s",
Review Comment:
Reverted order
--
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]