-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-50329][SQL] fix InSet$toString #48865
base: master
Are you sure you want to change the base?
Conversation
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment otherwise LGTM.
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizerLoggingSuite.scala
Outdated
Show resolved
Hide resolved
I am fine with this change but just wanted to make sure - does it affect any end-user usecase? |
It won't affect any successful queries, as queries running successfully either don't have unresolved children for InSet during execution or don't enable loggings calling InSet$toString. Queries failed due to InSet$toString will run successfully after the change. |
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
Outdated
Show resolved
Hide resolved
cc @cloud-fan |
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizerLoggingSuite.scala
Outdated
Show resolved
Hide resolved
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
Outdated
Show resolved
Hide resolved
@@ -609,6 +609,9 @@ case class InSet(child: Expression, hset: Set[Any]) extends UnaryExpression with | |||
require(hset != null, "hset could not be null") | |||
|
|||
override def toString: String = { | |||
if (!child.resolved) { | |||
return s"$child INSET " + hset.toSeq.mkString("(", ", ", ")") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what we will see if hset
elements are arrays like Array[Byte]
- just address of the array, for timestamp - some number of microseconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, without data type there is not much we can do.
What changes were proposed in this pull request?
Fix InSet$toString for unresolved plan node
Why are the changes needed?
InSet$toString should always work even for unresolved node
Does this PR introduce any user-facing change?
No
How was this patch tested?
end to end test by running TPCDS benchmark suite with planChangeLog enabled.
Was this patch authored or co-authored using generative AI tooling?
No