zhengxiang378928908-code commented on PR #12862: URL: https://github.com/apache/seatunnel/pull/12862#issuecomment-7181863884
Thanks, @SEZ9, for the detailed review, and @DanielLeens for the follow-up. Pushed `a0162f497d`, which addresses all eight points: 1. **Bounded work before rejection.** Before `setScale`, `toCarrierText` checks the integer digits, an upper bound on the length of the resulting text, and (when fraction digits must be dropped) the digit count and trailing zero bits. `fromCarrierText` rejects text longer than `3 + p + |s|` before matching or parsing it, `fromSparkValue` checks a `UTF8String`'s byte length before decoding it, and the digits of the unscaled value are counted before `BigDecimal` parses them. For a negative scale, the trailing zeros are checked in the text and only the digits before them are parsed, without a division. `WideDecimalTest` checks under a timeout that `1E+100000000`, `1E-100000000` and oversized carrier text are rejected without being expanded. 2. **Multi-table attribution.** `MultiTableManager` passes each source table's path and column names to its converters, so a value error names the source table and column instead of `columnN`. 3. **Doris example.** Both Spark guides now use PostgreSQL `NUMERIC(50, 10)`, and both incompatible-changes entries say this change alone does not affect Doris, because the Doris source still declares `LARGEINT` as `DECIMAL(20, 0)`. The Doris migration wording is in #12787. 4. **No value in errors.** A `SPARK-TRANSLATION-02` error names the column path, the declared type, the reason, and the table when known. It omits the rejected value. 5. **Unexpected carriers.** On Spark reads, both converters keep `null` and reject a non-text wide-decimal carrier with `SPARK-TRANSLATION-02`. The ordinary-decimal fallback error in `InternalRowConverter` now names the column. 6. **`fromMetadata` scope.** The architecture page and the Javadoc say it is a schema read-back utility that the job path does not call. A null precision or scale now raises `SPARK-TRANSLATION-03`; a null scale could previously be read as 0. 7. **Fallback collection path.** The `TypeConverterUtils` fallback builds the path only on failure, includes the root field when the caller passes it (for example `tags.element.amount`), and says the table is unknown at that point. 8. **Contracts.** The two metadata keys (both values are stored as `long`), the public methods and the exception contract now have Javadoc. Also in this push: wide decimals with a negative scale (PostgreSQL 15+ `NUMERIC(p, -s)`) now round-trip through the Spark carrier, and the read rule on the architecture page now states the limit precisely (the unscaled value at scale `s` has at most `p` digits). Verification: with Spotless, the Spark translation common module builds and `WideDecimalTest` (31 tests), `MultiTableManagerTest` (7) and `OffsetDateTimeUtilsTest` (6) pass on JDK 11. The `seatunnel-translation-spark-2.4` and `-3.3` modules build. About CI: I can't attach a fork run for this head. Actions on my fork has not run since 2026-11-05. Dispatching `Build` returns `HTTP 422: Actions has been disabled for this repository`, although the repository's Actions permissions API reports `enabled: true`. I'll post the Build link once it runs again. If a maintainer can start the checks from the upstream side, that would help too. -- 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]
