nsivabalan commented on a change in pull request #4712:
URL: https://github.com/apache/hudi/pull/4712#discussion_r802272328
##########
File path:
hudi-common/src/main/java/org/apache/hudi/common/table/HoodieTableConfig.java
##########
@@ -330,10 +360,28 @@ public static void create(FileSystem fs, Path
metadataFolder, Properties propert
if (hoodieConfig.contains(TIMELINE_TIMEZONE)) {
HoodieInstantTimeGenerator.setCommitTimeZone(HoodieTimelineTimeZone.valueOf(hoodieConfig.getString(TIMELINE_TIMEZONE)));
}
+ if (hoodieConfig.contains(TABLE_CHECKSUM)) {
+ hoodieConfig.setValue(TABLE_CHECKSUM,
hoodieConfig.getString(TABLE_CHECKSUM));
+ } else {
+ hoodieConfig.setValue(TABLE_CHECKSUM,
String.valueOf(generateChecksum(hoodieConfig.getProps())));
+ }
hoodieConfig.getProps().store(outputStream, "Properties saved on " + new
Date(System.currentTimeMillis()));
}
}
+ public static long generateChecksum(Properties props) {
+ if (!props.containsKey(NAME.key())) {
+ throw new IllegalArgumentException(NAME.key() + " property needs to be
specified");
+ }
+ String table = props.getProperty(NAME.key());
+ String database = props.getProperty(DATABASE_NAME.key(), "");
+ return
SpillableMapUtils.generateChecksum(String.format(TABLE_CHECKSUM_FORMAT,
database, table).getBytes(UTF_8));
Review comment:
generateChecksum does not fit in well in SpillableMapUtils. may be
previously it was used only in there, but now we may want to move to some other
util class.
--
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]