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

HIVE-25306: Move Date and Timestamp parsing from ResolverStyle.LENIENT to ResolverStyle.STRICT #2445

Closed

Conversation

ashish-kumar-sharma
Copy link
Contributor

What changes were proposed in this pull request?

Currently Date.java and Timestamp.java use DateTimeFormatter for parsing to convert the date/timpstamp from int,string,char etc to Date or Timestamp.

Default DateTimeFormatter which use ResolverStyle.LENIENT which mean date like "1992-13-12" is converted to "2000-01-12",

Moving DateTimeFormatter which use ResolverStyle.STRICT which mean date like "1992-13-12" is not be converted instead NULL is return.

Why are the changes needed?

ResolverStyle.LENIENT to ResolverStyle.STRICT

Does this PR introduce any user-facing change?

No

How was this patch tested?

UTs and QTs added as part of PR

@ashish-kumar-sharma
Copy link
Contributor Author

@zabetak Could you please review the PR?

Copy link
Contributor

@mattmccline-microsoft mattmccline-microsoft left a comment

Choose a reason for hiding this comment

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

Excellent work.

@adesh-rao
Copy link
Contributor

This is going to change the behavior for customers. Previously, the queries which used to work fine, will start throwing exception now.
Maybe we should put it behind a flag ?

@sankarh
Copy link
Contributor

sankarh commented Jul 9, 2021

This is going to change the behavior for customers. Previously, the queries which used to work fine, will start throwing exception now.
Maybe we should put it behind a flag ?

I'm also in favour of keeping this change within a config.
@zabetak What is your opinion?

@zabetak
Copy link
Contributor

zabetak commented Jul 9, 2021

@mattmccline-microsoft @ashish-kumar-sharma @sankarh I added a few comments in the JIRA since I think we should agree there before doing a line by line review.

@ashish-kumar-sharma
Copy link
Contributor Author

@zabetak @sankarh Addressed all the comments and got green build also. Could you guys please review the PR?

Copy link
Contributor

@zabetak zabetak left a comment

Choose a reason for hiding this comment

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

LGTM, I will merge this now!

@zabetak zabetak closed this in ba96607 Jul 23, 2021
zchovan pushed a commit to zchovan/hive that referenced this pull request Jul 29, 2021
…sh Kumar Sharma, reviewed by Adesh Kumar Rao, Matt McCline, Sankar Hariappan, Stamatis Zampetakis)

With this change parsing string literals to dates/timestamps does not tolerate
dates which do not conform exactly to the expected syntax and does not compensate
for months, days, etc., out of the usual ranges.

When the literal cannot be parsed the null value is returned adopting
the default MySQL behavior.

This is a breaking change.

Closes apache#2445
dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Dec 15, 2022
…sh Kumar Sharma, reviewed by Adesh Kumar Rao, Matt McCline, Sankar Hariappan, Stamatis Zampetakis)

With this change parsing string literals to dates/timestamps does not tolerate
dates which do not conform exactly to the expected syntax and does not compensate
for months, days, etc., out of the usual ranges.

When the literal cannot be parsed the null value is returned adopting
the default MySQL behavior.

This is a breaking change.

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

Successfully merging this pull request may close these issues.

6 participants