1
0

[HUDI-353] Add hive style partitioning path

This commit is contained in:
Wenning Ding
2019-10-30 10:41:04 -07:00
committed by Balaji Varadarajan
parent 63e330b17c
commit e555aa516d
8 changed files with 72 additions and 26 deletions

View File

@@ -105,7 +105,10 @@ public class TimestampBasedKeyGenerator extends SimpleKeyGenerator {
if (recordKey == null || recordKey.isEmpty()) {
throw new HoodieKeyException("recordKey value: \"" + recordKey + "\" for field: \"" + recordKeyField + "\" cannot be null or empty.");
}
return new HoodieKey(recordKey, partitionPathFormat.format(timestamp));
String partitionPath = hiveStylePartitioning ? partitionPathField + "=" + partitionPathFormat.format(timestamp)
: partitionPathFormat.format(timestamp);
return new HoodieKey(recordKey, partitionPath);
} catch (ParseException pe) {
throw new HoodieDeltaStreamerException("Unable to parse input partition field :" + partitionVal, pe);
}