SEPURI-SAI-KRISHNA commented on code in PR #19706:
URL: https://github.com/apache/hudi/pull/19706#discussion_r3835814655
##########
hudi-common/src/main/java/org/apache/hudi/common/table/PartitionPathParser.java:
##########
@@ -43,18 +43,37 @@ public class PartitionPathParser {
public Object[] getPartitionFieldVals(Option<String[]> partitionFields,
String partitionPath,
HoodieSchema writerSchema) {
+ return getPartitionFieldVals(partitionFields, partitionPath, writerSchema,
false);
+ }
+
+ /**
+ * @param slashSeparatedDatePartitioning whether the table was written with
+ * {@code hoodie.datasource.write.slash.separated.date.partitioning},
in which case a
+ * partition value spans several path segments rather than one.
+ */
+ public Object[] getPartitionFieldVals(Option<String[]> partitionFields,
+ String partitionPath,
+ HoodieSchema writerSchema,
+ boolean
slashSeparatedDatePartitioning) {
if (!partitionFields.isPresent()) {
return new Object[0];
}
- return getPartitionValues(partitionFields.get(), partitionPath,
writerSchema);
+ return getPartitionValues(partitionFields.get(), partitionPath,
writerSchema, slashSeparatedDatePartitioning);
}
private static Object[] getPartitionValues(String[] partitionFields,
String partitionPath,
- HoodieSchema schema) {
+ HoodieSchema schema,
+ boolean
slashSeparatedDatePartitioning) {
String[] parts = partitionPath.split("/");
int pathSegment = 0;
boolean hasDateField = false;
+ // NOTE: The writer only slash-separates a table partitioned by a single
column -- see the guard
Review Comment:
`[[...]]` is established convention in Hudi's Java sources rather than stray
Scala notation — 39 Java files use it, including
`BaseHoodieTableFileIndex.java` (L153, L491, L494), `HoodieListPairData.java`
(L195) and `HoodieAvroIndexedRecord.java` (L343).
I would rather stay consistent with the surrounding code than introduce a
second style in this one file, so I have left it as is. Happy to switch to
plain prose if a committer prefers it.
--
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]