You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/09/16 18:04:33 UTC
[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9413: [WIP] Add a new API to fix segment date time in metadata
Jackie-Jiang commented on code in PR #9413:
URL: https://github.com/apache/pinot/pull/9413#discussion_r973274073
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/util/ZKMetadataUtils.java:
##########
@@ -56,6 +60,32 @@ public static void refreshSegmentZKMetadata(String tableNameWithType, SegmentZKM
segmentSizeInBytes, false);
}
+ public static void updateSegmentZKMetadataInterval(TableConfig tableConfig, SegmentZKMetadata segmentZKMetadata,
+ Schema oldSchema, Schema newSchema) {
+ String timeColumnName = tableConfig.getValidationConfig().getTimeColumnName();
+ if (StringUtils.isNotEmpty(timeColumnName)) {
+ DateTimeFieldSpec currentDateTimeFieldSpec = oldSchema.getDateTimeSpec(timeColumnName);
+ DateTimeFieldSpec newDateTimeFieldSpec = newSchema.getDateTimeSpec(timeColumnName);
+
+ long startTime = segmentZKMetadata.getStartTimeMs();
Review Comment:
Currently we store the converted start/end time in the ZK metadata (always EPOCH). We should also store the raw min/max time in the ZK metadata, and use them and the schema to re-generate the start/end time.
When the raw min/max time value doesn't comply with the time format, or converted start/end time is not in the right range, we can put `null` as start/end time, and make the caller able to handle it (e.g. skip the segment for time management purpose)
--
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: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org