gengliangwang commented on PR #55936:
URL: https://github.com/apache/spark/pull/55936#issuecomment-4511518421
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 API?**
`CastUtils.changePrecisionExact` calls `d.changePrecision(precision, scale)`
in-place; `Decimal.toPrecision(...)` does the same logical work but clones the
input first (`val copy = clone()`). The in-place variant avoids a per-row
allocation, so the helpers serve a distinct purpose.
2. **Are the eval-path additions redundant?** The pre-PR `changePrecision`
method was an 8-line if-changePrecision { ... } else { if nullOnOverflow null
else throw } block; the helpers shrink it to 5 lines. Not a one-liner that was
already concise.
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]