-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Improve] [Connector-V2] File Connector add lzo compression way. #3782
Conversation
.../src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseFileSinkConfig.java
Outdated
Show resolved
Hide resolved
IMO, using the enum to limit the method of compress is better. Orc and parquet file format also have other compress method |
Add compression enum completed. |
@@ -50,7 +50,7 @@ public class BaseFileSinkConfig implements DelimiterConfig, CompressConfig, Seri | |||
|
|||
public BaseFileSinkConfig(@NonNull Config config) { | |||
if (config.hasPath(BaseSinkConfig.COMPRESS_CODEC.key())) { | |||
if ("lzo".equals(config.getString(BaseSinkConfig.COMPRESS_CODEC.key()))) { | |||
if (CompressFormat.LZO.getCompressCodec().equals(config.getString(BaseSinkConfig.COMPRESS_CODEC.key()))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks.
@@ -115,7 +116,7 @@ private FSDataOutputStream getOrCreateOutputStream(@NonNull String filePath) { | |||
FSDataOutputStream fsDataOutputStream = beingWrittenOutputStream.get(filePath); | |||
if (fsDataOutputStream == null) { | |||
try { | |||
if ("lzo".equals(compressCodec)) { | |||
if (CompressFormat.LZO.getCompressCodec().equals(compressCodec)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
switch is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks.
Waiting CI completed. |
Could you please offer test screenshot images to verify this pull request is work? The following points need to be verified:
|
|
The traditional method is to end with a compressed code, but it doesn't use the ending method you mentioned. csv is just a separation symbol problem, which has been tested |
cc @EricJoy2048 |
@TyrantLucifer plesase review and merge , thanks. |
I agree with you, |
@TyrantLucifer @Hisoka-X please review .thanks. |
@EricJoy2048 plesase review . |
…apache#3782) * add lzo compression way. * format code style * add CompressFormat enum. * Judge with switch statement. * fix CompressFormat enum valueOf adapt * Repair NPE when compression is not set. * add license header. * fix CI problem. * CompressFormat enum add default value NONE. * Supplement lzo compressed documents. * Supplement lzo compressed documents. * modify file name ends with *.lzo.txt Co-authored-by: zhaoliang01 <zhaoliang01@58.com>
…apache#3782) * add lzo compression way. * format code style * add CompressFormat enum. * Judge with switch statement. * fix CompressFormat enum valueOf adapt * Repair NPE when compression is not set. * add license header. * fix CI problem. * CompressFormat enum add default value NONE. * Supplement lzo compressed documents. * Supplement lzo compressed documents. * modify file name ends with *.lzo.txt Co-authored-by: zhaoliang01 <zhaoliang01@58.com>
Purpose of this pull request
Check list
New License Guide