bhollis-dbx opened a new pull request, #58802: URL: https://github.com/apache/spark/pull/58802
### What changes were proposed in this pull request? This pull request reduces temporary allocations in ANSI type coercion by matching `BinaryOperator` expressions without tuple-producing extractors, replacing an `Option.map` chain with direct matching, and reusing the two immutable decimal coercion rule chains selected by `spark.sql.legacy.literal.pickMinimumPrecision`. It also adds a regression test confirming that combined ANSI coercion invokes every rule in order when earlier rules return the original expression. ### Why are the changes needed? ANSI type coercion allocates temporary tuples, closures, and partial-function chains while traversing expressions that remain unchanged. Large expression trees amplify this allocation cost and increase analysis memory and latency. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Added an ordering regression test and ran: `build/sbt 'catalyst/testOnly *AnsiTypeCoercionSuite *DecimalPrecisionSuite'` All 62 tests passed. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: OpenAI Codex (GPT-5) -- 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]
