Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

averyqi-db
Copy link
Contributor

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

@github-actions github-actions bot added the SQL label Nov 16, 2024
@HyukjinKwon HyukjinKwon changed the title [SQL][SPARK-50329] fix InSet$toString [SPARK-50329][SQL] fix InSet$toString Nov 16, 2024
Copy link
Contributor

@attilapiros attilapiros left a 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.

@HyukjinKwon
Copy link
Member

I am fine with this change but just wanted to make sure - does it affect any end-user usecase?

@averyqi-db
Copy link
Contributor Author

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.

@HyukjinKwon
Copy link
Member

cc @cloud-fan

@@ -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("(", ", ", ")")
Copy link
Member

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?

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants