MaxGekk opened a new pull request, #42855:
URL: https://github.com/apache/spark/pull/42855

   ### What changes were proposed in this pull request?
   In the PR, I propose to check that the `class` and `method` arguments are 
not a NULL in `CallMethodViaReflection`. And if they are, throw an 
`AnalysisException` with new error class `DATATYPE_MISMATCH.UNEXPECTED_NULL`.
   
   ### Why are the changes needed?
   To fix the issue demonstrated by the example:
   ```sql
   $ spark-sql (default)> select reflect('java.util.UUID', CAST(NULL AS 
STRING));
   [INTERNAL_ERROR] The Spark SQL phase analysis failed with an internal error. 
You hit a bug in Spark or the Spark plugins you use. Please, report this bug to 
the corresponding communities or vendors, and provide the full stack trace.
   ``` 
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   ### How was this patch tested?
   By running new test:
   ```
   $ build/sbt "test:testOnly *.MiscFunctionsSuite"
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No.
   
   Authored-by: Max Gekk <[email protected]>
   (cherry picked from commit fd424caf6c46e7030ac2deb2afbe3f4a5fc1095c)


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