NestDream opened a new issue, #9716:
URL: https://github.com/apache/paimon/issues/9716

   ### Search before asking
   - [x] I searched in the issues and found nothing similar.
   
   ### Paimon version
   master (d77efe0). Also 1.3.x and 1.4.x, introduced by #5972.
   
   ### Compute Engine
   Flink 1.20.1, kafka_sync_table with canal-json.
   
   ### Minimal reproduce step
   1. Catalog with `case-sensitive=false` (the Hive catalog default). Create 
the table first: `orders (id INT, create_time TIMESTAMP(3), dt STRING, PRIMARY 
KEY (id, dt) NOT ENFORCED) PARTITIONED BY (dt)`.
   2. Start `kafka_sync_table` on an empty canal-json topic with 
`--computed_column 'dt=date_format(create_time,yyyy-MM-dd)'`. The table exists 
and no record is available, so the job builds the computed column from the 
Paimon schema with `caseSensitive=false`.
   3. Produce one record with `create_time = 2023-03-23 10:15:00`.
   
   ### What doesn't meet your expectations?
   The record lands in partition `dt=2023-03-82` instead of `dt=2023-03-23`, 
with no error. `sortComputedColumnArgs` upper-cases the whole argument, so the 
pattern becomes `YYYY-MM-DD` (week year, day of year).
   
   Two more effects of the same upper-casing: with lower-case source column 
names the job restarts on every record with `Cannot write null to non-null 
column(dt)`, because the upper-cased reference does not match the record; and a 
computed column referencing another computed column fails with `Referenced 
field '...' is not in given fields`.
   
   ### Anything else?
   Introduced by #5972, which upper-cases the whole argument before parsing it.
   
   ### Are you willing to submit a PR?
   - [x] I'm willing to submit a PR!
   


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