-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18937][SQL] Timezone support in CSV/JSON parsing #16750
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
aa052f4
Add timeZone option to JSONOptions.
ueshin 890879e
Apply timeZone option to JSON datasources.
ueshin f08b78c
Apply timeZone option to CSV datasources.
ueshin 551cff9
Modify python files.
ueshin bdad5b7
Move new arguments to the end of the argument list.
ueshin d5ab37c
Modify JSONOptions/CSVOptions to take default timezone id argument.
ueshin 9b30a9c
Merge branch 'master' into issues/SPARK-18937
ueshin dec84e0
Use `InternalRow.apply()` instead of `InternalRow.fromSeq()`.
ueshin ffc4912
Add a comment to explain the test result.
ueshin a455f4f
Merge branch 'master' into issues/SPARK-18937
ueshin ae6397d
Merge branch 'master' into issues/SPARK-18937
ueshin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Modify JSONOptions/CSVOptions to take default timezone id argument.
- Loading branch information
commit d5ab37c7e1bdcd79586b802f3450bfbc7a9a8f36
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
shouldn't the
timeZoneIdjust an option inparameterswith keytimeZoneId?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.
I put the
timeZoneoption every time creatingJSONOptions(orCSVOptions), but there were the same contains-key check logic many times as @HyukjinKwon mentioned.So I modified to pass the default timezone id to
JSONOptionsandCSVOptions.Uh oh!
There was an error while loading. Please reload this page.
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.
Ah, yes, it needed to introduce such logics below before creating
JSONOptions/CSVOptions.So, I suggested this way as It seems also because the default value of
timeZonecan be varied. It seemsParquetOptions.compressionCodecClassNamealso takes another argument for the same reason.Another way I suggested is, to make this
Option[TimeZone]to decouple the variant of the default value (likeJSONOptions.columnNameOfCorruptRecord) but it seemstimestampFormatin both options are dependent ontimeZone. In that case, we should make itOptiontoo which seems introducing some more complexity. So, it seems above way is better.I am fine if we find a better cleaner way.
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.
To cut this short, I think we can resemble
JSONOptions.columnNameOfCorruptRecordorParquetOptions.compressionCodecClassNameto deal with the variant of default value.It seems now it resembles the latter.