yihua opened a new issue, #20817:
URL: https://github.com/apache/hudi/issues/20817

   `SqlKeyGenerator` converts a TIMESTAMP partition value to milliseconds and 
prints it as `yyyy-MM-dd HH:mm:ss`, so the partition path drops everything 
below the second. Rows whose values differ only below the second share one 
partition path, and a reader that takes the partition value from the path 
(partition pruning in the Spark file index, or 
`hoodie.datasource.read.extract.partition.values.from.path`) sees the truncated 
value: a filter on the exact value prunes the row away, and the value read back 
differs from the one written.
   
   Changing the path for existing tables would route updates of existing rows 
to a different partition, so the layout has to be fixed per table. Proposal: 
record a table config when a partitioned table is created, true for new tables 
at the current table version, under which `SqlKeyGenerator` writes the value as 
Spark renders a timestamp cast to a string (up to six fractional digits, no 
trailing zeros, e.g. `2024-02-29 10%3A30%3A00.123456`). A whole-second value 
keeps its current path, and tables without the config keep truncating.
   


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