fatmanverse commented on PR #12920:
URL: https://github.com/apache/seatunnel/pull/12920#issuecomment-6430990246
Thanks @DanielLeens, good catch: `ZetaSQLFunction.computeForValue` returns a
`Double` for a numeric literal with a decimal point, so the examples I wrote as
`CAST(1.21 ...)` and `CAST(1.15 ...)` described a DOUBLE source, not the
DECIMAL or STRING case. Fixed in ee9fe22, docs and tests only:
- `incompatible-changes.md` (en/zh): the examples are now phrased by the
source column type: a DECIMAL or STRING column holding `1.21` gave `1.3` and
now gives `1.2` (`-1.25`: `-1.2` -> `-1.3`), and a STRING or DECIMAL column
holding `1.15` gives `1.2` while a DOUBLE column holding `1.15` gives `1.1`.
The entry also says that a numeric SQL literal such as `CAST(1.21 AS
DECIMAL(10,1))` is a DOUBLE source and so already gave `1.2`, and that a quoted
literal such as `CAST('1.21' AS DECIMAL(10,1))` is a STRING source.
- New `SystemFunctionTest#testCastOfNumericAndQuotedLiteralsViaSqlEngine`
runs the literal forms through the SQL engine and pins what the note says:
`CAST(1.21 ...)` = `1.2`, `CAST('1.21' ...)` = `1.2`, `CAST(1.15 ...)` = `1.1`,
`CAST('1.15' ...)` = `1.2`.
On JDK 17, `./mvnw -pl seatunnel-transforms-v2 test` passes: 1494 tests, 0
failures (18 skipped), `SystemFunctionTest` 27/27.
--
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]