linhongliu-db opened a new pull request, #59882:
URL: https://github.com/apache/spark/pull/59882

   ### What changes were proposed in this pull request?
   
   Mark `ToNumberBase` and numeric `ToCharacter` as stateful so fresh evaluator 
copies create separate cached `ToNumberParser` instances.
   
   ### Why are the changes needed?
   
   `ToNumberParser` mutates its working state during parsing and formatting. 
Without the stateful marker, fresh evaluator copies can share both the 
expression and the parser referenced by generated code.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. `to_number`, `try_to_number`, and numeric `to_char` no longer share 
mutable parsers between fresh evaluator copies. Supported formats, NULL 
handling, and literal folding are unchanged.
   
   ### How was this patch tested?
   
   Regression tests check fresh expression identity, separate parser references 
in generated code, preserved foldability, conversion results, and NULL inputs 
for all three expressions.
   
   Full Catalyst suite passed: 76 tests, zero failures. The new regression 
cases failed against the unmodified production code.
   
   ```bash
   build/sbt 'catalyst/testOnly *StringExpressionsSuite'
   ```
   
   Scala style checks passed for the Catalyst and SQL source and test code.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Codex CLI 0.164.0 (GPT-6)
   


-- 
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]

Reply via email to