zhengxiang378928908-code commented on PR #12920: URL: https://github.com/apache/seatunnel/pull/12920#issuecomment-7231856010
Hi @fatmanverse, this PR currently conflicts with `dev`. I merged `dev` into your branch and resolved the conflicts on my fork, in case it saves you some time: https://github.com/zhengxiang378928908-code/seatunnel/tree/fix-sql-cast-decimal-rounding-merge-dev It is two commits on top of your head `85167a2`, so you can fetch it and fast-forward your branch: ``` git fetch https://github.com/zhengxiang378928908-code/seatunnel.git fix-sql-cast-decimal-rounding-merge-dev git merge --ff-only FETCH_HEAD ``` **`03e22de` Merge `dev`** - `.github/workflows/backend.yml`: both timeout conflicts take the `dev` values (180 for `all-connectors-it-3`, 150 for `connector-file-local-it`). `dev` already raised them by 30 minutes, and these jobs do not run the SQL transform tests, so the extra increase seemed out of scope here. - `incompatible-changes.md` (en/zh): kept both new sections, in the order HBase DELETE → SQL CAST DECIMAL → MongoDB. - `dev` moved `func_system.conf` and `TestSQLIT` from transforms-v2-e2e part-2 to part-1. Git followed the rename, so your e2e assertions are now in part-1. **`b046d10` Docs and tests** - The CASE note said digits are dropped only when a value has more decimal places than its declared type. A branch value can also carry more scale than the inferred result type. For example, with `a DECIMAL(3,2) = 1.21` and `b DECIMAL(2,1) = 2.0`, `CASE WHEN 1=1 THEN MOD(a, b) ELSE b END` is `DECIMAL(2,1)` and gives `1.3` on `dev` and `1.2` with this PR. I added this example to the en/zh guide, with a unit test. - zh guide: "舍入到目标精度" → "舍入到目标小数位数 `s`", to match "target scale" in the English text. - Both guides now note that a conversion that drops no digits can still fail the precision check, e.g. `CAST(10 AS DECIMAL(2,1))`. Added a unit test for it. - e2e `func_system.conf`: `TRY_CAST('-9.94' AS DECIMAL(2,1))` → `-9.9` and `TRY_CAST('-9.95' AS DECIMAL(2,1))` → `NULL`. **Verification (JDK 11)** - `seatunnel-transforms-v2` unit tests: 2054 run, 0 failures. - The CASE example on unmodified `dev`: `1.3`, type `Decimal(2, 1)`. - `TestSQLIT` in transforms-v2-e2e part-1 (`-Pci`, Docker): 32 run, 0 failures. `testSQLTransform` with the updated `func_system.conf` passed on all 7 containers. - `spotless:check` and `git diff --check` pass. Feel free to take all of it, only the merge, or none of it. -- 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]
