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-35720][SQL] Support casting of String to timestamp without time zone type #32898

Closed
wants to merge 1 commit into from

Conversation

pingsutw
Copy link
Member

What changes were proposed in this pull request?

Extend the Cast expression and support casting of String to timestamp without time zone type

Why are the changes needed?

To conform the ANSI SQL standard which requires to support such casting.

Does this PR introduce any user-facing change?

No, the new timestamp type is not released yet.

How was this patch tested?

Unit test

@github-actions github-actions bot added the SQL label Jun 13, 2021
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@HyukjinKwon HyukjinKwon changed the title [SPARK-35720][SQL] support casting of String to timestamp without time zone type [SPARK-35720][SQL] Support casting of String to timestamp without time zone type Jun 14, 2021

test("SPARK-35720: Support casting of String to timestamp without time zone type") {
specialTs.foreach { s =>
Copy link
Member

Choose a reason for hiding this comment

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

@pingsutw could you test multiple time zone as the default, similar to #32878?
Also, we should test input strings with time zone like 2021-06-14 15:01:24+08:00 as well, which expects 2021-06-14 15:01:24.

Copy link
Member

Choose a reason for hiding this comment

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

As I mentioned in https://issues.apache.org/jira/browse/SPARK-35720, I don't think we can simply use stringToTimestamp here. You will find that when you have more test cases here.

Copy link
Member Author

Choose a reason for hiding this comment

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

@gengliangwang thanks for the review. Will update ASAP.

@gengliangwang
Copy link
Member

@pingsutw any update on this? The project of timestamp without time zone requires implementing subtract/add operations and this conversion will be needed for end-to-end testing.

@gengliangwang
Copy link
Member

@pingsutw Sorry but I have to create #32936 to unblock the next steps of the project.

@pingsutw
Copy link
Member Author

@gengliangwang Sorry, I was in the army a couple days ago.

@gengliangwang
Copy link
Member

@pingsutw It's OK :)

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