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

[Beam-14528]: Add ISO time format support for Timestamp, Date, DateTime, Time field. #17778

Merged
merged 20 commits into from
Jun 8, 2022

Conversation

yirutang
Copy link
Contributor

@yirutang yirutang commented May 27, 2022

With this fix, we should be able to accept:
Timestamp
"12345"
“2022-05-09T18:04:59Z” UTC
“2022-05-09T18:04:59.739-07:00”
“2022-05-09 18:04:59” UTC
Datetime
“2022-05-09T18:04:59”
“2022-05-09 18:04:59”

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

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • 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

See CI.md for more information about GitHub Actions CI.

@asf-ci
Copy link

asf-ci commented May 27, 2022

Can one of the admins verify this patch?

1 similar comment
@asf-ci
Copy link

asf-ci commented May 27, 2022

Can one of the admins verify this patch?

@yirutang yirutang changed the title [Beam-14528]: Add ISO time format support for Timestamp field. [Beam-14528]: Add ISO time format support for Timestamp, Date, DateTime, Time field. May 28, 2022
@yirutang
Copy link
Contributor Author

yirutang commented May 28, 2022

R: @chamikaramj

@yirutang
Copy link
Contributor Author

yirutang commented May 31, 2022

R: @reuvenlax

} catch (DateTimeParseException e) {
return ChronoUnit.MICROS.between(
// "12345667"
ChronoUnit.MICROS.between(
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the formatted datetime would be the more-common case, right? If so, then we should probably try to parse using the DateTimeFormatter first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, I thought long is more common.

@pabloem
Copy link
Member

pabloem commented Jun 2, 2022

Run Java PostCommit

@pabloem
Copy link
Member

pabloem commented Jun 2, 2022

Run Java PreCommit

@reuvenlax
Copy link
Contributor

Please fix unit-test failures - they look related.

@yirutang
Copy link
Contributor Author

yirutang commented Jun 2, 2022

Please fix unit-test failures - they look related.

PTAL, I double checked backend implementation, and found two things:

  1. it turned the timezone based format support shouldn't be accepted on datetime, time and date. But the datetime does support space.
  2. It seems due to some todo, the space based timezone was based on UTC instead of local time.
    https://screenshot.googleplex.com/3qnQKNrqsYJgCi8

@reuvenlax
Copy link
Contributor

please run ./gradlew spotlessApply to fix spotless errors

@yirutang
Copy link
Contributor Author

yirutang commented Jun 3, 2022

please run ./gradlew spotlessApply to fix spotless errors

sorry, done.

@reuvenlax
Copy link
Contributor

Run Java PreCommit

@yirutang
Copy link
Contributor Author

yirutang commented Jun 3, 2022

Run Java PreCommit

1 similar comment
@reuvenlax
Copy link
Contributor

Run Java PreCommit

@reuvenlax
Copy link
Contributor

There is a CheckStyle warning to fix - https://ci-beam.apache.org/job/beam_PreCommit_Java_Phrase/5200/checkstyle/

@pabloem
Copy link
Member

pabloem commented Jun 8, 2022

Run Java PreCommit

1 similar comment
@reuvenlax
Copy link
Contributor

Run Java PreCommit

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.

None yet

4 participants