gengliangwang commented on PR #55935: URL: https://github.com/apache/spark/pull/55935#issuecomment-4511518162
Audited this PR for the same lessons surfaced by @viirya and @cloud-fan on #55938 (and applied to #55934 / #55939): 1. **Are the helpers redundant with an existing Scala object?** No — `ByteExactNumeric` / `ShortExactNumeric` only have trivial `toByte(byte)` / `toShort(short)` (same-type). Cross-type narrowing with bounds check (e.g. `int -> byte` throwing `castingCauseOverflowError`) doesn't exist on any `*ExactNumeric` object, so the new `intToByteExact`, `longToByteExact`, ... helpers are genuinely net-new. 2. **Are the eval-path additions redundant?** No — master `castToByte` / `castToShort` ANSI bodies are multi-line (call `exactNumeric.toInt(b)` with a try/catch, then bounds-check the int down to byte/short). The new helpers consolidate those bodies into a one-line call. So no changes needed on this PR for that review. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
