hudi-agent commented on code in PR #19706:
URL: https://github.com/apache/hudi/pull/19706#discussion_r3835456318
##########
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:
🤖 nit: `[[KeyGenUtils#getRecordPartitionPath]]` (and `[[#inferDateValue]]`
below) is Scala wiki-link notation — in a Java file it just looks like stray
bracket pairs to readers. Could you use plain prose or the fully-qualified
class name instead, e.g. `see KeyGenUtils#getRecordPartitionPath`?
<sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]