[CsvIO] Implemented CsvIOParseHelpers:parseCell#31802
[CsvIO] Implemented CsvIOParseHelpers:parseCell#31802damondouglas merged 4 commits intoapache:masterfrom
Conversation
|
Assigning reviewers. If you would like to opt out of this review, comment R: @damondouglas for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
|
assign to next reviewer |
|
Assigning reviewers. If you would like to opt out of this review, comment R: @kennknowles for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
sdks/java/io/csv/src/test/java/org/apache/beam/sdk/io/csv/ExamplePojo.java
Outdated
Show resolved
Hide resolved
| case FLOAT: | ||
| return Float.parseFloat(cell); | ||
| case DATETIME: | ||
| return Instant.parse(cell); |
There was a problem hiding this comment.
Is the value always going to be in a format such that instant can parse it?
There was a problem hiding this comment.
No, there is an error PCollection that is thrown for types that are not Default.
|
@johnjcasey Thank you for your review. @lahariguduru is my student and I will clear my review after yours. |
|
R: @Abacn |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
Abacn
left a comment
There was a problem hiding this comment.
Thanks, just had a comment
| case DATETIME: | ||
| return Instant.parse(cell); | ||
| default: | ||
| throw new IllegalArgumentException( |
There was a problem hiding this comment.
Consider UnsupportedOperationException ? Otherwise it will be caught in outer try block and throw again, which is redundant
There was a problem hiding this comment.
I completely agree, just changed the method to utilize UnsupportedOperationException instead.
…parseCell() method
* Created CsvIOHelpers method * Created CsvIOHelpers:parseCell method * deleted ExamplePojo class, created CsvIOParseHelpers::parseCell method * Changed IllegalArgumentException to UnsupportedOperationException in parseCell() method --------- Co-authored-by: Lahari Guduru <lahariguduru@google.com>
* Created CsvIOHelpers method * Created CsvIOHelpers:parseCell method * deleted ExamplePojo class, created CsvIOParseHelpers::parseCell method * Changed IllegalArgumentException to UnsupportedOperationException in parseCell() method --------- Co-authored-by: Lahari Guduru <lahariguduru@google.com>
This PR closes #31719.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.