-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Non-Deterministic expressions in an array_transform can cause errors #9472
Comments
There are two more expressions added to the original code I think according to this piece of code, Regarding the bug in the plugin, It is happening because we are running the |
@razajafri you are right this error has nothing to do with explode. It is a problem with non-determinism and higher order functions.
Caused the same error on Spark 3.3.0, but if we refactor it to pull the
I don't know yet why we are calling rand twice. I need to look into it more. |
Okay I figured it out and fixed it. It's my bad. It looks like I started to go down the route of making it computed once, but then ended up doing it twice for some odd reason. |
Describe the bug
In Spark 3.5.0 some change went in, we need to track it down to know what happened, but it expanded non-deterministic expressions to be run in more areas, not just the original Project, Filter, Aggregate and Window.
https://github.com/apache/spark/blob/8c2b3319c6734250ff9d72f3d7e5cab56b142195/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala#L584-L589
As a part of this in Spark 3.5.1 a bug fix went in for generate.
https://issues.apache.org/jira/browse/SPARK-45171
apache/spark@9c0b803ba12
But that bug fix happens during execution of the plan. We can run the query on 3.5.0 and get a different error.
We need to
Steps/Code to reproduce bug
I had a few issues with the SQL as is on some versions of Spark, so I went with this that appears to be a problem on every version that we support.
Expected behavior
We should be able to run the query correctly even if the CPU cannot.
The text was updated successfully, but these errors were encountered: