Skip to content

[CsvIO] Implemented CsvIOParseHelpers:parseCell#31802

Merged
damondouglas merged 4 commits intoapache:masterfrom
lahariguduru:csv-parse-helpers-parse-cell
Jul 11, 2024
Merged

[CsvIO] Implemented CsvIOParseHelpers:parseCell#31802
damondouglas merged 4 commits intoapache:masterfrom
lahariguduru:csv-parse-helpers-parse-cell

Conversation

@lahariguduru
Copy link
Copy Markdown
Contributor

This PR closes #31719.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: 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, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

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)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 8, 2024

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @damondouglas for label java.
R: @johnjcasey for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@damondouglas
Copy link
Copy Markdown
Contributor

assign to next reviewer

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 8, 2024

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @kennknowles for label java.
R: @johnjcasey for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@lahariguduru lahariguduru requested a review from damondouglas July 8, 2024 23:37
case FLOAT:
return Float.parseFloat(cell);
case DATETIME:
return Instant.parse(cell);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the value always going to be in a format such that instant can parse it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, there is an error PCollection that is thrown for types that are not Default.

@damondouglas damondouglas requested a review from johnjcasey July 9, 2024 19:56
@damondouglas
Copy link
Copy Markdown
Contributor

@johnjcasey Thank you for your review. @lahariguduru is my student and I will clear my review after yours.

@lahariguduru
Copy link
Copy Markdown
Contributor Author

R: @Abacn

@github-actions
Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

Copy link
Copy Markdown
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

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

Thanks, just had a comment

case DATETIME:
return Instant.parse(cell);
default:
throw new IllegalArgumentException(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider UnsupportedOperationException ? Otherwise it will be caught in outer try block and throw again, which is redundant

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I completely agree, just changed the method to utilize UnsupportedOperationException instead.

@damondouglas damondouglas merged commit e646c28 into apache:master Jul 11, 2024
acrites pushed a commit to acrites/beam that referenced this pull request Jul 17, 2024
* 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>
reeba212 pushed a commit to reeba212/beam that referenced this pull request Dec 4, 2024
* 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>
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.

[CsvIO]: Create CsvIOParseHelpers::parseCell(String, Schema.Field)

4 participants