SEZ9 commented on issue #13361:
URL: https://github.com/apache/seatunnel/issues/13361#issuecomment-7087857140

   @hutiefang76 thanks for checking the physical representation and not just 
the declared precision.
   
   Your Calcite 1.38.0 result settles the direction. Raising the type-system 
limit makes `TIMESTAMP` and `TIMESTAMP_WITH_LOCAL_TIME_ZONE` report precision 
6, but the Enumerable value is still a `long`/`Long`. `.123456` and `.123789` 
therefore both become `1718469010123`.
   
   That rules out both candidate fixes: the epoch-millisecond conversion and a 
precision-only override. Either one would replace the visible 
`ClassCastException` with silently wrong projection, comparison and interval 
results.
   
   I agree with your proposal to wait for a precision-preserving Enumerable 
timestamp representation under 
[CALCITE-5266](https://issues.apache.org/jira/browse/CALCITE-5266) before 
touching the SeaTunnel adapter.
   
   Remaining asks:
   
   - **No adapter PR for now.** Please do not open one on either of the two 
bases above. This issue stays open as blocked on the upstream runtime 
representation.
   - **Upstream tracking.** Please post here when CALCITE-5266 makes progress, 
or if you find another Calcite physical representation that keeps six 
fractional digits.
   - **Reproduction.** If you can, please attach the small type-system override 
experiment (setup, the two input values, observed runtime values). That lets us 
re-run it unchanged when the bundled Calcite version changes.
   - **Future proposal.** It should first show a precision-preserving physical 
representation on the bundled Calcite version. The regression should then cover:
     - `TIMESTAMP` and `TIMESTAMP_TZ`;
     - standalone projection and whole-second interval arithmetic;
     - equality, inequality and ordering;
     - null controls;
     - two distinct values within the same millisecond.
   
     It should run through both the direct engine and the `FakeSource -> 
Calcite -> Console` job.
   - **Out of scope.** The existing SeaTunnel timestamp types and connector 
APIs stay unchanged, and `TIME` stays out of this fix. The MySQL CDC scenario 
is optional follow-up evidence.
   
   <!-- streview-comment:2543 -->


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