-
Notifications
You must be signed in to change notification settings - Fork 29k
[MINOR][SQL] Simplify DateTimeUtils.cleanLegacyTimestampStr #28892
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
Conversation
|
Test build #124358 has finished for PR 28892 at commit
|
|
Test build #124359 has finished for PR 28892 at commit
|
|
@srowen @dongjoon-hyun @cloud-fan @HyukjinKwon Could you review the little refactoring. |
Fokko
left a comment
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.
Love it
| } | ||
| } | ||
| // the "GMT" string. For example, it returns 2000-01-01T00:00+01:00 for 2000-01-01T00:00GMT+01:00. | ||
| def cleanLegacyTimestampStr(s: UTF8String): UTF8String = s.replace(gmtUtf8, UTF8String.EMPTY_UTF8) |
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.
doesn't the java.lang.String have the replace method?
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.
It has but look at how it is implemented via regexp. @JoshRosen implemented more effective replace in UTF8String #24707. That's why I took it. I hope it seems reasonable.
|
thanks, merging to master! |
HyukjinKwon
left a comment
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.
Late LGTM too
What changes were proposed in this pull request?
Call the
replace()method fromUTF8Stringto remove theGMTstring from the input ofDateTimeUtils.cleanLegacyTimestampStr. It removes allGMTsubstrings.Why are the changes needed?
Simpler code improves maintainability
Does this PR introduce any user-facing change?
Should not
How was this patch tested?
By existing test suites
JsonSuiteandUnivocityParserSuite.