LuciferYang opened a new pull request, #11241:
URL: https://github.com/apache/paimon/pull/11241

   ### Purpose
   
   close #11228
   
   Precision 0 maps to the Arrow `SECOND` unit, which the Mosaic native writer 
does not accept. A Mosaic table with a `TIMESTAMP(0)` or `TIMESTAMP(0) WITH 
LOCAL TIME ZONE` column can be created, but every write fails with `writer open 
failed: unsupported Timestamp unit: Second`. MySQL CDC creates such columns 
from `DATETIME`.
   
   `MosaicFileFormat.validateDataFields` now rejects precision 0, also inside 
`ARRAY` and `MAP`, with the same message style as the other types Mosaic 
rejects, and suggests `TIMESTAMP(3)`.
   
   This check also runs when a table is loaded. An existing Mosaic table with a 
`TIMESTAMP(0)` column could not be written before and now cannot be read 
either, until the column is changed to `TIMESTAMP(3)` or `file.format` is set 
back. Both ALTERs work on such a table.
   
   ### Tests
   
   `MosaicFileFormatTest`:
   - `testValidateDataFieldsTimestampPrecisionZeroUnsupported` checks the full 
message for `TIMESTAMP(0)`, `ARRAY<TIMESTAMP(0)>`, `TIMESTAMP(0) WITH LOCAL 
TIME ZONE` and `MAP<STRING, TIMESTAMP(0) WITH LOCAL TIME ZONE>`. It fails 
without the change.
   - `testValidateDataFieldsTimestampPositivePrecisionSupported` checks that 
precisions 1 and 9 of both types are still accepted.
   


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