Eliaaazzz opened a new pull request, #40157:
URL: https://github.com/apache/beam/pull/40157
Part of #39684. Depends on #40156 (the first five commits); review the last
commit.
`beam:logical_type:timestamp:v1` is a timestamp with a precision argument:
the number of subsecond digits, stored as a row of `seconds` (INT64) and non
negative `subseconds` (INT16 below precision 5, INT32 otherwise). The Go row
coder is built from the Go type alone, so each precision needs its own Go type:
this PR adds `schema.TimestampMillis`, `schema.TimestampMicros` and
`schema.TimestampNanos` (precision 3, 6 and 9, the values Java exposes as
constants), registered with `RegisterParameterizedLogicalTypeConversion`. A
schema with another precision fails with `unknown logical type ... with
argument`, and further precisions can be registered with one line each.
Encoding a value with more subsecond digits than the type carries returns an
error, as the Java `Timestamp` logical type does; decoding validates the
subseconds range. The INT16 `subseconds` field of the millisecond type depends
on the big endian INT16 encoding of the first PR in the series.
The three `timestamp:v1` cases of standard_coders.yaml now run in the Go
regression test, which means every logical type row case in the file runs.
Tests: schema conversion for the three precisions (argument and
representation), byte level row encoding against the yaml examples (including
timestamps before the epoch), precision and range errors, and an unsupported
precision.
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [x] 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.
- [x] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more
tips on [how to make review process
smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit
[https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more
information about GitHub Actions CI or the [workflows
README](https://github.com/apache/beam/blob/master/.github/workflows/README.md)
to see a list of phrases to trigger workflows.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]