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-34881][SQL][FOLLOWUP] Implement toString() and sql() methods for TRY_CAST #32098

Closed
wants to merge 3 commits into from

Conversation

gengliangwang
Copy link
Member

What changes were proposed in this pull request?

Implement toString() and sql() methods for TRY_CAST

Why are the changes needed?

The new expression should have a different name from CAST in SQL/String representation.

Does this PR introduce any user-facing change?

Yes, in the result of explain(), users can see try_cast if the new expression is used.

How was this patch tested?

Unit tests.

@SparkQA
Copy link

SparkQA commented Apr 8, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41661/

@SparkQA
Copy link

SparkQA commented Apr 8, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41661/

@github-actions github-actions bot added the SQL label Apr 8, 2021
@SparkQA
Copy link

SparkQA commented Apr 8, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41668/

@SparkQA
Copy link

SparkQA commented Apr 8, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41668/

@SparkQA
Copy link

SparkQA commented Apr 8, 2021

Test build #137083 has finished for PR 32098 at commit 9cb723a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.


test("try_cast: to_string") {
assert(TryCast(Literal("1"), IntegerType).toString == "try_cast(1 as int)")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test sql as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already verified in the try_cast.sql.out.

@SparkQA
Copy link

SparkQA commented Apr 8, 2021

Test build #137090 has finished for PR 32098 at commit e028030.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@gengliangwang
Copy link
Member Author

Merging to master

@maropu
Copy link
Member

maropu commented Apr 9, 2021

late lgtm.

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