You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "clairemcginty (via GitHub)" <gi...@apache.org> on 2024/08/28 19:25:24 UTC
[PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
clairemcginty opened a new pull request, #32352:
URL: https://github.com/apache/beam/pull/32352
fixes #32349
Adds support for Zstandard compression in Avro writes
------------------------
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](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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn merged PR #32352:
URL: https://github.com/apache/beam/pull/32352
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "clairemcginty (via GitHub)" <gi...@apache.org>.
clairemcginty commented on code in PR #32352:
URL: https://github.com/apache/beam/pull/32352#discussion_r1747437492
##########
sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/io/SerializableAvroCodecFactory.java:
##########
@@ -50,6 +50,9 @@ class SerializableAvroCodecFactory implements Externalizable {
private static final Pattern deflatePattern = Pattern.compile(DEFLATE_CODEC + "-(?<level>-?\\d)");
private static final Pattern xzPattern = Pattern.compile(XZ_CODEC + "-(?<level>\\d)");
+ // Don't reference `DataFileConstants.ZSTANDARD_CODEC` directly for Avro 1.8 compat
+ private static final Pattern zstdPattern = Pattern.compile("zstandard\\[(?<level>\\d+)\\]");
Review Comment:
oh great catch! added a `-?` to the regex and updated the tests.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #32352:
URL: https://github.com/apache/beam/pull/32352#issuecomment-2338611318
thank you for prompt responses!
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "clairemcginty (via GitHub)" <gi...@apache.org>.
clairemcginty commented on PR #32352:
URL: https://github.com/apache/beam/pull/32352#issuecomment-2332270025
cc @Abacn, since I saw you made some recent commits to Beam's avro module? :)
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on code in PR #32352:
URL: https://github.com/apache/beam/pull/32352#discussion_r1747395407
##########
sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/io/SerializableAvroCodecFactory.java:
##########
@@ -50,6 +50,9 @@ class SerializableAvroCodecFactory implements Externalizable {
private static final Pattern deflatePattern = Pattern.compile(DEFLATE_CODEC + "-(?<level>-?\\d)");
private static final Pattern xzPattern = Pattern.compile(XZ_CODEC + "-(?<level>\\d)");
+ // Don't reference `DataFileConstants.ZSTANDARD_CODEC` directly for Avro 1.8 compat
+ private static final Pattern zstdPattern = Pattern.compile("zstandard\\[(?<level>\\d+)\\]");
Review Comment:
Sorry for late question. zstandard compression level range from negative 7 to 22. This regex does not handle negative, is this a concern?
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "clairemcginty (via GitHub)" <gi...@apache.org>.
clairemcginty commented on code in PR #32352:
URL: https://github.com/apache/beam/pull/32352#discussion_r1735188030
##########
sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/io/SerializableAvroCodecFactory.java:
##########
@@ -50,6 +50,9 @@ class SerializableAvroCodecFactory implements Externalizable {
private static final Pattern deflatePattern = Pattern.compile(DEFLATE_CODEC + "-(?<level>-?\\d)");
private static final Pattern xzPattern = Pattern.compile(XZ_CODEC + "-(?<level>\\d)");
+ // Don't reference `DataFileConstants.ZSTANDARD_CODEC` directly for Avro 1.8 compat
+ private static final Pattern zstdPattern = Pattern.compile("zstandard\\[(?<level>\\d+)\\]");
Review Comment:
Note: DataFileConstants.STANDARD_CODEC was added in [Avro 1.9](https://github.com/apache/avro/blob/release-1.9.2/lang/java/avro/src/main/java/org/apache/avro/file/DataFileConstants.java#L41C30-L41C45), so I didn't want to reference it here and break 1.8 users. When Avro 1.8 is dropped it can be used directly
##########
sdks/java/extensions/avro/src/main/java/org/apache/beam/sdk/extensions/avro/io/SerializableAvroCodecFactory.java:
##########
@@ -50,6 +50,9 @@ class SerializableAvroCodecFactory implements Externalizable {
private static final Pattern deflatePattern = Pattern.compile(DEFLATE_CODEC + "-(?<level>-?\\d)");
private static final Pattern xzPattern = Pattern.compile(XZ_CODEC + "-(?<level>\\d)");
+ // Don't reference `DataFileConstants.ZSTANDARD_CODEC` directly for Avro 1.8 compat
+ private static final Pattern zstdPattern = Pattern.compile("zstandard\\[(?<level>\\d+)\\]");
Review Comment:
Note: `DataFileConstants.ZSTANDARD_CODEC` was added in [Avro 1.9](https://github.com/apache/avro/blob/release-1.9.2/lang/java/avro/src/main/java/org/apache/avro/file/DataFileConstants.java#L41C30-L41C45), so I didn't want to reference it here and break 1.8 users. When Avro 1.8 is dropped it can be used directly
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32352:
URL: https://github.com/apache/beam/pull/32352#issuecomment-2316204792
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #32352:
URL: https://github.com/apache/beam/pull/32352#issuecomment-2336816884
merge conflicts after other change pushed CHANGES.md change, would you mind rebase onto the latest master? thanks!
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "clairemcginty (via GitHub)" <gi...@apache.org>.
clairemcginty commented on PR #32352:
URL: https://github.com/apache/beam/pull/32352#issuecomment-2338321003
> merge conflicts after other change pushed CHANGES.md change, would you mind rebase onto the latest master? thanks!
cc @Abacn done! 🫡
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Support Zstd codec in SerializableAvroCodecFactory [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #32352:
URL: https://github.com/apache/beam/pull/32352#issuecomment-2317774288
Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
R: @kennknowles for label java.
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).
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org