prashantwason opened a new pull request, #18090:
URL: https://github.com/apache/hudi/pull/18090

   ### Describe the issue this Pull Request addresses
   
   Closes HUDI-6286
   
   When `FlinkOptions.RECORD_KEY_FIELD` is set to empty, Flink Hudi allows 
auto-generation of `hoodie_record_key` without specifying a primary key UUID 
(which is nullified in the ingestion job). However, the partition format was 
incorrectly set in this scenario.
   
   ### Summary and Changelog
   
   Use `TimestampBasedAvroKeyGenerator` to format partitions in the 
`AutoRowDataKeyGen` class, consistent with the behavior in `RowDataKeyGen`.
   
   **Changes:**
   - Updated `AutoRowDataKeyGen` constructor to accept an optional 
`TimestampBasedAvroKeyGenerator`
   - Modified `instance()` method to detect when 
`TimestampBasedAvroKeyGenerator` is configured and instantiate it appropriately
   - Added unit test `testTimestampBasedKeyGeneratorForKeylessWrite` to verify 
correct partition path formatting
   
   ### Impact
   
   This fix ensures that when using keyless writes with timestamp-based 
partitioning, the partition path is formatted correctly according to the 
configured partition format.
   
   ### Risk Level
   
   low - The change only affects the `AutoRowDataKeyGen` class used for keyless 
writes with timestamp-based partitioning. Existing behavior for other key 
generation scenarios is unchanged.
   
   ### Documentation Update
   
   none
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable


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