SEPURI-SAI-KRISHNA commented on PR #12605:
URL: https://github.com/apache/seatunnel/pull/12605#issuecomment-5969821479

   Thanks @DanielLeens. Issue 1 is a real mistake of mine, and your 
parenthetical about `5.0` was the important part of it.
   
   My first attempt at the fix still said "a fractional source is rejected", 
which implies `CAST(5.0 AS TINYINT)` works. It does not. Measured:
   
   | source | to `TINYINT` | to `INT` |
   | --- | --- | --- |
   | `Double` `5.0` | error | `5` |
   | `Double` `5.7` | error | `5` |
   | `BigDecimal` `5.0` | error | `5` |
   | `BigDecimal` `5` | `5` | `5` |
   
   It is the string form that decides it, not the fraction: 
`Byte.parseByte("5.0")` fails. Both pages now read:
   
   > A floating-point source is handled differently per target. Casting to 
`INT` | `INTEGER` truncates it towards zero, so `CAST(5.7 AS INT)` gives `5`. 
Casting to `TINYINT`, `SMALLINT` or `BYTE` rejects it, including a whole value 
such as `5.0`, because those targets parse the value's string form as an 
integer.
   
   **Issue 2.** Left as is, which you marked optional. `ZetaSQLEngine` already 
adds the expression text when it rethrows, which is how `cast(s AS TINYINT)` 
appears in existing failures. An assertion here would pin the wrapper's format, 
shared by every transform error, rather than this change's behaviour. Happy to 
add one if you disagree.
   
   **`all-connectors-it-7`, the cause you could not find.** 
`PostgresCDCIT.testPostgresCdcSnapshotOnlyAndCommittedOffsetStartupModes[1]`, 
37 tests with 1 error, about 260s, which is #11847. Not specific to this PR: 
the identical test and signature failed on my unrelated #12568 in the same 
window. Rerunning the failed jobs now.
   
   **BIGINT.** Thanks for settling it. Filing the separate issue and will link 
it from the incompatible-changes entry.
   
   **Javadoc rationale paragraph.** Keeping it, since you and @SEZ9 both said 
to.
   


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