spark
spark copied to clipboard
[SPARK-49976] [SQL] Disallow lambda functions from being clauses in CASE WHEN expressions
What changes were proposed in this pull request?
Throw the exception from the proper place in code.
Why are the changes needed?
Lambda functions can only be used as arguments of a small list of functions and therefore should be disallowed when they are part of CASE WHEN clauses.
Does this PR introduce any user-facing change?
Yes, the error will be thrown from the parser instead of the analyzer.
How was this patch tested?
Added test.
Was this patch authored or co-authored using generative AI tooling?
Copilot.