SEPURI-SAI-KRISHNA commented on code in PR #19648:
URL: https://github.com/apache/hudi/pull/19648#discussion_r3815127185


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/keygen/PartitionPathFormatterBase.java:
##########
@@ -62,11 +62,11 @@ public final S combine(List<String> partitionPathFields, 
Object... partitionPath
     // Avoid creating [[StringBuilder]] in case there's just one 
partition-path part,
     // and Hive-style of partitioning is not required
     if (!useHiveStylePartitioning && partitionPathParts.length == 1) {
-      if (slashSeparatedDatePartitioning) {
-        return ((S) ((String) toString(partitionPathParts[0])).replace('-', 
'/'));
-      } else {
-        return tryEncode(handleEmpty(toString(partitionPathParts[0])));
-      }
+      S partitionPathPart = 
tryEncode(handleEmpty(toString(partitionPathParts[0])));
+      // NOTE: Slash-separated date partitioning only kicks in for a table 
partitioned by a single

Review Comment:
   Both applied.
   
   The NOTE now scopes the single-field statement to 
SimpleKeyGenerator/ComplexKeyGenerator, cites KeyGenUtils#getPartitionPath 
alongside getRecordPartitionPath, and states explicitly that CustomKeyGenerator 
is not an exception -- it builds one single-field sub-key-generator per 
partition field, so every field takes that branch and a multi-field table does 
get each value slash-separated on Avro, Row and InternalRow alike.
   
   TestCustomKeyGenerator.testSlashSeparatedDatePartitioning now asserts Row 
and InternalRow. One thing worth flagging: it partitioned on "timestamp:simple" 
and did avroRecord.put("timestamp", "2026-01-05"), but "timestamp" is a long in 
EXAMPLE_SCHEMA -- Avro tolerates it because getNestedFieldValAsString just 
stringifies, but converting that record to a Row against STRUCT_TYPE (LongType) 
does not work. The test now uses the string-typed "ts_ms", which is what makes 
the Row/InternalRow asserts possible at all.



-- 
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]

Reply via email to