Flink: Add Sink options to override the compression properties of the Table#6049
Merged
stevenzwu merged 2 commits intoapache:masterfrom Oct 26, 2022
Merged
Flink: Add Sink options to override the compression properties of the Table#6049stevenzwu merged 2 commits intoapache:masterfrom
stevenzwu merged 2 commits intoapache:masterfrom
Conversation
nastra
approved these changes
Oct 25, 2022
Contributor
nastra
left a comment
There was a problem hiding this comment.
changes LGTM and make sense, but would be good to have somebody with more Flink knowledge review this as well
stevenzwu
reviewed
Oct 25, 2022
stevenzwu
reviewed
Oct 25, 2022
stevenzwu
reviewed
Oct 25, 2022
| writeProperties.put(AVRO_COMPRESSION, conf.avroCompressionCodec()); | ||
| level = conf.avroCompressionLevel(); | ||
| if (level != null) { | ||
| writeProperties.put(AVRO_COMPRESSION_LEVEL, conf.avroCompressionLevel()); |
Contributor
There was a problem hiding this comment.
nit: can use level in this line.
Contributor
Author
There was a problem hiding this comment.
I hate when the blocks in the switch are not independent.
I refactored to use a different variable instead inside each block
stevenzwu
approved these changes
Oct 26, 2022
Contributor
Contributor
Author
|
Thanks @stevenzwu and @nastra for the review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on my performance tests using
snappycodec to write out files is 40% more performant that writing with gzip.Since with Flink there is an additional compaction step which overwrites the original data files anyway, it would be useful to first write out the files with
snappyand use the table codec only at the compaction time.To provide this functionality additional
FlinkWriteOptionsare added to modify the table default settings for: