FLINK 1.9.1 StreamingFileSink 压缩问题

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FLINK 1.9.1 StreamingFileSink 压缩问题

CHENJIE
各位好,FLINK 1.9.1 使用 StreamingFileSink 写Parquet到HDFS,能启用压缩吗?

--代码
StreamingFileSink<HDFSBean> sink = StreamingFileSink
        .forBulkFormat(new Path(FILE_HDFS_PATH), ParquetAvroWriters.forReflectRecord(HDFSBean.class))
        .withBucketAssigner(new DateTimeBucketAssigner<>(FILE_HDFS_FORMAT))

        .build();

Reply | Threaded
Open this post in threaded view
|

Re: FLINK 1.9.1 StreamingFileSink 压缩问题

JingsongLee
Hi,

看起来你只能改下connector代码才能支持压缩了:
ParquetAvroWriters.createAvroParquetWriter里:设置AvroParquetWriter.Builder的压缩格式。

Best,
Jingsong Lee


------------------------------------------------------------------
From:USERNAME <[hidden email]>
Send Time:2020年1月2日(星期四) 13:36
To:user-zh <[hidden email]>
Subject:FLINK 1.9.1 StreamingFileSink 压缩问题

各位好,FLINK 1.9.1 使用 StreamingFileSink 写Parquet到HDFS,能启用压缩吗?

--代码
StreamingFileSink<HDFSBean> sink = StreamingFileSink
        .forBulkFormat(new Path(FILE_HDFS_PATH), ParquetAvroWriters.forReflectRecord(HDFSBean.class))
        .withBucketAssigner(new DateTimeBucketAssigner<>(FILE_HDFS_FORMAT))

        .build();

Reply | Threaded
Open this post in threaded view
|

Re:Re: FLINK 1.9.1 StreamingFileSink 压缩问题

CHENJIE
非常感谢帮助!
祝腊八快乐,祝大家腊八愉快!!

在 2020-01-02 15:00:25,"JingsongLee" <[hidden email]> 写道:

>Hi,
>
>看起来你只能改下connector代码才能支持压缩了:
>ParquetAvroWriters.createAvroParquetWriter里:设置AvroParquetWriter.Builder的压缩格式。
>
>Best,
>Jingsong Lee
>
>
>------------------------------------------------------------------
>From:USERNAME <[hidden email]>
>Send Time:2020年1月2日(星期四) 13:36
>To:user-zh <[hidden email]>
>Subject:FLINK 1.9.1 StreamingFileSink 压缩问题
>
>各位好,FLINK 1.9.1 使用 StreamingFileSink 写Parquet到HDFS,能启用压缩吗?
>
>--代码
>StreamingFileSink<HDFSBean> sink = StreamingFileSink
>        .forBulkFormat(new Path(FILE_HDFS_PATH), ParquetAvroWriters.forReflectRecord(HDFSBean.class))
>        .withBucketAssigner(new DateTimeBucketAssigner<>(FILE_HDFS_FORMAT))
>
>        .build();
>