SEPURI-SAI-KRISHNA commented on code in PR #19710:
URL: https://github.com/apache/hudi/pull/19710#discussion_r3835986292
##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/SlashEncodedDayPartitionValueExtractor.java:
##########
@@ -65,4 +73,11 @@ public List<String> extractPartitionValuesInPath(String
partitionPath) {
return Collections.singletonList(dateTime.format(getDtfOut()));
}
+
+ private static boolean isDefaultPartition(String partitionPath) {
+ // a Hive-style directory carries the column name, e.g.
"datestr=__HIVE_DEFAULT_PARTITION__"
+ int separator = partitionPath.indexOf('=');
+ String value = separator < 0 ? partitionPath :
partitionPath.substring(separator + 1);
Review Comment:
Applied — both markers are now matched.
Two things made it worth doing rather than scoping out.
`PartitionPathParser#parseValue` and `Type.java:103` already accept either
marker on the read side, so matching only the
current one here was the odd one out. And while `FourToFiveUpgradeHandler`
hard-fails the upgrade when a `default` partition exists, that check is
skippable via
`hoodie.skip.default.partition.validation`, so a legacy table can still
reach these extractors.
Folded into the shared helper from your other comment:
`PartitionPathEncodeUtils#isDefaultPartitionValue` handles both. A legacy
`default` directory still maps to
`__HIVE_DEFAULT_PARTITION__` as the returned value, since that is what
Hive records for a null partition value — the directory name and the recorded
value are independent.
`TestPartitionValueExtractor` covers bare `default` and `col=default` for
both extractors; both new cases fail without the change.
--
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]