SEPURI-SAI-KRISHNA commented on issue #12612: URL: https://github.com/apache/seatunnel/issues/12612#issuecomment-5969955231
Taking this one, and recording why the PR does not follow immediately so nobody picks it up expecting it to be free. **It is sequenced behind #12605, not stalled.** That PR fixes the same defect for `INT` and introduces the machinery this fix needs in `SystemFunction`: a per-numeric-family range check (`numberToInt`), a `BigInteger` bounds comparison (`intFromExact`) and a shared failure builder (`outOfIntRange`). The `BIGINT` fix is the same shape against the long bounds, so it should extend those rather than reinvent them. Writing it against `dev` today would mean two problems. The helpers do not exist there yet, so I would be adding a near-duplicate `outOfLongRange` that a reviewer would reasonably ask to be unified. And #12605 inserts its helper block immediately before `castAs(List<Object>)`, which is exactly where a `BIGINT` helper wants to go, so two independent branches would conflict in that file. #12605 is already approved on the source side, and I would rather not put a merge conflict in front of it. So the plan is: #12605 merges, then this PR goes up on top of it, reusing the same helpers with `Long.MIN_VALUE` / `Long.MAX_VALUE` bounds and the same truncate-then-range-check order. **What the fix will cover,** from the measurements in the issue body: `BigDecimal` and `BigInteger` beyond 64 bits, which currently keep only the low-order 64 bits; `NaN`, which currently becomes `0`; and infinities and huge magnitudes, which currently saturate to `Long.MAX_VALUE`. Fraction handling will be left exactly as it is, as it was in #12605, since changing that is a separate decision. Tests will follow #12605's shape: exact `Long` boundaries, one step beyond each, `TRY_CAST` returning null for the rejected values, and the widening and identity conversions pinned as controls. Context for anyone arriving here cold: this was split out of #12571 at @DanielLeens's suggestion, since the agreed scope there was `TINYINT`, `SMALLINT` and `INT`. -- 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]
