This is an automated email from the ASF dual-hosted git repository.
davidzollo pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new d198cbc804 [Fix][Connector-V2][File] Support ZSTD-compressed ORC reads
and writes (#13084)
d198cbc804 is described below
commit d198cbc8041a21652d67e5869c2512e0a55f2736
Author: taowenjun <[email protected]>
AuthorDate: Sat Nov 28 13:58:40 2026 +0800
[Fix][Connector-V2][File] Support ZSTD-compressed ORC reads and writes
(#13084)
Co-authored-by: 陶文俊 <[email protected]>
---
docs/en/connectors/sink/CosFile.md | 2 +-
docs/en/connectors/sink/FtpFile.md | 2 +-
docs/en/connectors/sink/HdfsFile.md | 6 +-
docs/en/connectors/sink/LocalFile.md | 4 +-
docs/en/connectors/sink/ObsFile.md | 2 +-
docs/en/connectors/sink/OssFile.md | 2 +-
docs/en/connectors/sink/OssJindoFile.md | 2 +-
docs/en/connectors/sink/S3File.md | 2 +-
docs/en/connectors/sink/SftpFile.md | 2 +-
.../introduction/concepts/incompatible-changes.md | 7 +
docs/zh/connectors/sink/CosFile.md | 2 +-
docs/zh/connectors/sink/FtpFile.md | 2 +-
docs/zh/connectors/sink/HdfsFile.md | 6 +-
docs/zh/connectors/sink/LocalFile.md | 4 +-
docs/zh/connectors/sink/ObsFile.md | 2 +-
docs/zh/connectors/sink/OssFile.md | 2 +-
docs/zh/connectors/sink/OssJindoFile.md | 2 +-
docs/zh/connectors/sink/S3File.md | 2 +-
docs/zh/connectors/sink/SftpFile.md | 2 +-
.../introduction/concepts/incompatible-changes.md | 7 +
.../connector-file/connector-file-base/pom.xml | 10 +-
.../seatunnel/file/config/CompressFormat.java | 4 +-
.../seatunnel/file/config/FileBaseSinkOptions.java | 3 +-
.../file/writer/OrcWriteStrategyTest.java | 170 +++++++++++++++++++++
.../seatunnel/file/local/LocalFileFactoryTest.java | 50 ++++++
.../e2e/connector/file/local/LocalFileIT.java | 60 ++++++++
.../resources/orc/local_file_orc_compression.conf | 37 +++++
.../orc/local_file_orc_compression_to_assert.conf | 46 ++++++
28 files changed, 420 insertions(+), 22 deletions(-)
diff --git a/docs/en/connectors/sink/CosFile.md
b/docs/en/connectors/sink/CosFile.md
index e249e28ac3..e712cb116b 100644
--- a/docs/en/connectors/sink/CosFile.md
+++ b/docs/en/connectors/sink/CosFile.md
@@ -212,7 +212,7 @@ The compress codec of files and the details that supported
as the following show
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
Tips: excel type does not support any compression format.
diff --git a/docs/en/connectors/sink/FtpFile.md
b/docs/en/connectors/sink/FtpFile.md
index b566826ba1..a0f342f895 100644
--- a/docs/en/connectors/sink/FtpFile.md
+++ b/docs/en/connectors/sink/FtpFile.md
@@ -221,7 +221,7 @@ The compress codec of files and the details that supported
as the following show
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
Tips: excel type does not support any compression format
diff --git a/docs/en/connectors/sink/HdfsFile.md
b/docs/en/connectors/sink/HdfsFile.md
index 78767bcd38..ae95f055cd 100644
--- a/docs/en/connectors/sink/HdfsFile.md
+++ b/docs/en/connectors/sink/HdfsFile.md
@@ -72,7 +72,7 @@ Output data to hdfs file
| sink_columns | array | no |
| When this parameter is empty, all fields are sink
columns.Which columns need be write to file, default value is all of the
columns get from `Transform` or `Source`. The order of the fields determines
the order in which the file is actually written.
[...]
| is_enable_transaction | boolean | no | true
| If `is_enable_transaction` is true, we will ensure
that data will not be lost or duplicated when it is written to the target
directory.Please note that, If `is_enable_transaction` is `true`, we will auto
add `${transactionId}_` in the head of the file.Only support `true` now.
[...]
| batch_size | int | no | 1000000
| The maximum number of rows in a file. For
SeaTunnel Engine, the number of lines in the file is determined by `batch_size`
and `checkpoint.interval` jointly decide. If the value of `checkpoint.interval`
is large enough, sink writer will write rows in a file until the rows in the
file larger than `batch_size`. If `checkpoint.interval` is small, the sink
writer will create a new file [...]
-| compress_codec | string | no | none
| The compress codec of files and the details that
supported as the following shown:[txt: `lzo` `none`,json: `lzo` `none`,csv:
`lzo` `none`,orc: `lzo` `snappy` `lz4` `zlib` `none`,parquet: `lzo` `snappy`
`lz4` `gzip` `brotli` `zstd` `none`].Tips: excel type does not support any
compression format.
[...]
+| compress_codec | string | no | none
| The compress codec of files and the details that
supported as the following shown:[txt: `lzo` `none`,json: `lzo` `none`,csv:
`lzo` `none`,orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`,parquet: `lzo`
`snappy` `lz4` `gzip` `brotli` `zstd` `none`].Tips: excel type does not support
any compression format.
[...]
| krb5_path | string | no | /etc/krb5.conf
| The krb5 path of kerberos
[...]
| kerberos_principal | string | no | -
| The principal of kerberos
[...]
| kerberos_keytab_path | string | no | -
| The keytab path of kerberos
[...]
@@ -151,6 +151,10 @@ The replica number of sink writers used for each table in
a multi-table sink job
Only used when file_format_type is canal_json,debezium_json or maxwell_json.
When value is true, the UPDATE_AFTER and UPDATE_BEFORE event will be merged
into UPDATE event data
+### ORC ZSTD compatibility
+
+ORC supports `compress_codec = "zstd"`. The shared file connector ORC
dependency is upgraded from 1.5.6 to 1.8.7. ZSTD output is genuinely
compressed, and downstream readers must support ORC ZSTD; keeping ORC file
version 0.12 does not make older readers compatible. Verify or upgrade
downstream readers before enabling ZSTD, or retain a mutually supported codec
such as `snappy` or `zlib`. The default remains `none`.
+
## Task Example
### Simple
diff --git a/docs/en/connectors/sink/LocalFile.md
b/docs/en/connectors/sink/LocalFile.md
index 3cf6bcb005..6a8863a8ad 100644
--- a/docs/en/connectors/sink/LocalFile.md
+++ b/docs/en/connectors/sink/LocalFile.md
@@ -194,9 +194,11 @@ The compress codec of files and the details that supported
as the following show
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
+ORC supports `compress_codec = "zstd"`. The shared file connector ORC
dependency is upgraded from 1.5.6 to 1.8.7. ZSTD output is genuinely
compressed, and downstream readers must support ORC ZSTD; keeping ORC file
version 0.12 does not make older readers compatible. Verify or upgrade
downstream readers before enabling ZSTD, or retain a mutually supported codec
such as `snappy` or `zlib`. The default remains `none`.
+
Tips: excel type does not support any compression format
### common options
diff --git a/docs/en/connectors/sink/ObsFile.md
b/docs/en/connectors/sink/ObsFile.md
index 29e239e383..af9532d04b 100644
--- a/docs/en/connectors/sink/ObsFile.md
+++ b/docs/en/connectors/sink/ObsFile.md
@@ -183,7 +183,7 @@ Please note that, The final file name will end with the
file_format's suffix, th
> - txt: `lzo` `none`
> - json: `lzo` `none`
> - csv: `lzo` `none`
-> - orc: `lzo` `snappy` `lz4` `zlib` `none`
+> - orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
> - parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
Please note that excel type does not support any compression format
diff --git a/docs/en/connectors/sink/OssFile.md
b/docs/en/connectors/sink/OssFile.md
index 38287e7da8..705815a976 100644
--- a/docs/en/connectors/sink/OssFile.md
+++ b/docs/en/connectors/sink/OssFile.md
@@ -256,7 +256,7 @@ The compress codec of files and the details that supported
as the following show
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
Tips: excel type does not support any compression format
diff --git a/docs/en/connectors/sink/OssJindoFile.md
b/docs/en/connectors/sink/OssJindoFile.md
index 0779113c7d..f079873cab 100644
--- a/docs/en/connectors/sink/OssJindoFile.md
+++ b/docs/en/connectors/sink/OssJindoFile.md
@@ -220,7 +220,7 @@ The compress codec of files and the details that supported
as the following show
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
Tips: excel type does not support any compression format.
diff --git a/docs/en/connectors/sink/S3File.md
b/docs/en/connectors/sink/S3File.md
index 5c5e2ba502..33ac76250d 100644
--- a/docs/en/connectors/sink/S3File.md
+++ b/docs/en/connectors/sink/S3File.md
@@ -261,7 +261,7 @@ The compress codec of files and the details that supported
as the following show
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
Tips: excel type does not support any compression format
diff --git a/docs/en/connectors/sink/SftpFile.md
b/docs/en/connectors/sink/SftpFile.md
index e278df72e5..c3ce87eefe 100644
--- a/docs/en/connectors/sink/SftpFile.md
+++ b/docs/en/connectors/sink/SftpFile.md
@@ -206,7 +206,7 @@ The compress codec of files and the details that supported
as the following show
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
Tips: excel type does not support any compression format
diff --git a/docs/en/introduction/concepts/incompatible-changes.md
b/docs/en/introduction/concepts/incompatible-changes.md
index a33d5279d1..e6731e61bc 100644
--- a/docs/en/introduction/concepts/incompatible-changes.md
+++ b/docs/en/introduction/concepts/incompatible-changes.md
@@ -5,6 +5,13 @@ You need to check this document before you upgrade to related
version.
## dev
+### File connectors: ORC ZSTD output requires compatible readers
+
+- **Affected component**: `connector-file-base` and file connectors using its
ORC reader/writer.
+- **Description**: Upgrade `orc-core:nohive` from 1.5.6 to 1.8.7, accept ZSTD
in the shared ORC sink configuration rule, and map ZSTD to ORC
`CompressionKind.ZSTD`. ZSTD-compressed ORC files can be read, and ORC output
configured with `compress_codec = "zstd"` is actually ZSTD-compressed instead
of mapping to NONE. Previously, file factories rejected ORC/ZSTD during
validation, while paths bypassing that rule could silently write uncompressed
output.
+- **Impact**: Newly generated ZSTD files require readers supporting ORC ZSTD.
Retaining ORC file version 0.12 does not provide codec support to older
readers. Existing files are not rewritten, and the default compression remains
NONE.
+- **Migration Guide**: Verify or upgrade downstream readers before enabling
ORC ZSTD. During a staged upgrade, explicitly retain a mutually supported codec
such as SNAPPY or ZLIB. (#13084)
+
### HBase sink: DELETE rows remove mapped data
`DELETE` rows now remove all cell versions up to the mutation timestamp in the
column families
diff --git a/docs/zh/connectors/sink/CosFile.md
b/docs/zh/connectors/sink/CosFile.md
index 78db36c17b..e0ffd2fd51 100644
--- a/docs/zh/connectors/sink/CosFile.md
+++ b/docs/zh/connectors/sink/CosFile.md
@@ -211,7 +211,7 @@ cos文件系统的分区.
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
Tips: excel 类型不支持任何压缩格式
diff --git a/docs/zh/connectors/sink/FtpFile.md
b/docs/zh/connectors/sink/FtpFile.md
index 9ca67a7a79..7f9c09e284 100644
--- a/docs/zh/connectors/sink/FtpFile.md
+++ b/docs/zh/connectors/sink/FtpFile.md
@@ -229,7 +229,7 @@ FTP 控制连接的字符编码。默认值为 `UTF-8`。
- csv:`lzo` `none`
-- orc:`lzo` `snappy` `lz4` `zlib` `none`
+- orc:`lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet:`lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none` `
diff --git a/docs/zh/connectors/sink/HdfsFile.md
b/docs/zh/connectors/sink/HdfsFile.md
index 0e7c987b62..a5fcfb2854 100644
--- a/docs/zh/connectors/sink/HdfsFile.md
+++ b/docs/zh/connectors/sink/HdfsFile.md
@@ -74,7 +74,7 @@ import ChangeLog from '../changelog/connector-file-hadoop.md';
| batch_size | int | 否 | 1000000
| 文件中的最大行数。对于 SeaTunnel Engine,文件中的行数由 `batch_size` 和
`checkpoint.interval` 共同决定。如果 `checkpoint.interval`
的值足够大,则接收器写入器将在文件中写入行,直到文件中的行大于 `batch_size`。如果 `checkpoint.interval`
很小,则接收器写入器将在新检查点触发时创建一个新文件。
|
| single_file_mode | boolean | 否 | false
| 每个并行度只会输出一个文件,当此参数开启时,batch_size就不会生效。输出的文件名没有文件块后缀。
|
| create_empty_file_when_no_data | boolean | 否 | false
| 当上游没有数据同步时,依然生成对应的数据文件。
|
-| compress_codec | string | 否 | none
| 文件的压缩编解码器及其支持的细节如下所示:[txt: `lzo` `none`,json: `lzo`
`none`,csv: `lzo` `none`,orc: `lzo` `snappy` `lz4` `zlib` `none`,parquet: `lzo`
`snappy` `lz4` `gzip` `brotli` `zstd` `none`]。提示:excel类型不支持任何压缩格式。
|
+| compress_codec | string | 否 | none
| 文件的压缩编解码器及其支持的细节如下所示:[txt: `lzo` `none`,json: `lzo`
`none`,csv: `lzo` `none`,orc: `lzo` `snappy` `lz4` `zlib` `zstd`
`none`,parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd`
`none`]。提示:excel类型不支持任何压缩格式。
|
| krb5_path | string | 否 | /etc/krb5.conf
| kerberos 的 krb5 路径
|
| kerberos_principal | string | 否 | -
| kerberos 的主体
|
| kerberos_keytab_path | string | 否 | -
| kerberos 的 keytab 路径
|
@@ -154,6 +154,10 @@ HdfsFile {
设置成true,序列化数据时,UPDATE_AFTER 和 UPDATE_BEFORE 会合并成 UPDATE;
设置成false,序列化数据时,UPDATE_AFTER 和 UPDATE_BEFORE 不会合并;
+### ORC ZSTD 兼容性
+
+ORC 支持 `compress_codec = "zstd"`。共享文件连接器的 ORC 依赖由 1.5.6 升级为 1.8.7,ZSTD 输出会实际采用
ZSTD 压缩。下游读取器必须支持 ORC ZSTD;保留 ORC 文件版本 0.12
并不能让旧读取器支持该压缩格式。启用前请先验证或升级下游读取器,或继续使用双方均支持的 `snappy`、`zlib` 等压缩格式。默认值仍为 `none`。
+
## 任务示例
### 简单示例
diff --git a/docs/zh/connectors/sink/LocalFile.md
b/docs/zh/connectors/sink/LocalFile.md
index e60de68cd4..aa0beb3aa8 100644
--- a/docs/zh/connectors/sink/LocalFile.md
+++ b/docs/zh/connectors/sink/LocalFile.md
@@ -193,9 +193,11 @@ import ChangeLog from
'../changelog/connector-file-local.md';
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
+ORC 支持 `compress_codec = "zstd"`。共享文件连接器的 ORC 依赖由 1.5.6 升级为 1.8.7,ZSTD 输出会实际采用
ZSTD 压缩。下游读取器必须支持 ORC ZSTD;保留 ORC 文件版本 0.12
并不能让旧读取器支持该压缩格式。启用前请先验证或升级下游读取器,或继续使用双方均支持的 `snappy`、`zlib` 等压缩格式。默认值仍为 `none`。
+
提示:excel 类型不支持任何压缩格式
### 常见选项
diff --git a/docs/zh/connectors/sink/ObsFile.md
b/docs/zh/connectors/sink/ObsFile.md
index 67d0cb6b8f..865bacdf35 100644
--- a/docs/zh/connectors/sink/ObsFile.md
+++ b/docs/zh/connectors/sink/ObsFile.md
@@ -182,7 +182,7 @@ import ChangeLog from '../changelog/connector-file-obs.md';
> - txt: `lzo` `none`
> - json: `lzo` `none`
> - csv: `lzo` `none`
-> - orc: `lzo` `snappy` `lz4` `zlib` `none`
+> - orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
> - parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
请注意,excel类型不支持任何压缩格式
diff --git a/docs/zh/connectors/sink/OssFile.md
b/docs/zh/connectors/sink/OssFile.md
index a193149711..9b4662abce 100644
--- a/docs/zh/connectors/sink/OssFile.md
+++ b/docs/zh/connectors/sink/OssFile.md
@@ -257,7 +257,7 @@ oss文件系统的endpoint端点。
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
提示:excel类型不支持任何压缩格式
diff --git a/docs/zh/connectors/sink/OssJindoFile.md
b/docs/zh/connectors/sink/OssJindoFile.md
index fcdb635544..98f383a331 100644
--- a/docs/zh/connectors/sink/OssJindoFile.md
+++ b/docs/zh/connectors/sink/OssJindoFile.md
@@ -218,7 +218,7 @@ OSS 端点,例如 `oss-cn-beijing.aliyuncs.com`。
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
提示:excel 格式不支持任何压缩格式。
diff --git a/docs/zh/connectors/sink/S3File.md
b/docs/zh/connectors/sink/S3File.md
index 5ff033c0a3..bc71f4a2ca 100644
--- a/docs/zh/connectors/sink/S3File.md
+++ b/docs/zh/connectors/sink/S3File.md
@@ -260,7 +260,7 @@ hadoop_s3_properties {
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
提示:excel 类型不支持任何压缩格式
diff --git a/docs/zh/connectors/sink/SftpFile.md
b/docs/zh/connectors/sink/SftpFile.md
index daf125d08f..de93b88119 100644
--- a/docs/zh/connectors/sink/SftpFile.md
+++ b/docs/zh/connectors/sink/SftpFile.md
@@ -205,7 +205,7 @@ import ChangeLog from '../changelog/connector-file-sftp.md';
- txt: `lzo` `none`
- json: `lzo` `none`
- csv: `lzo` `none`
-- orc: `lzo` `snappy` `lz4` `zlib` `none`
+- orc: `lzo` `snappy` `lz4` `zlib` `zstd` `none`
- parquet: `lzo` `snappy` `lz4` `gzip` `brotli` `zstd` `none`
提示:excel类型不支持任何压缩格式
diff --git a/docs/zh/introduction/concepts/incompatible-changes.md
b/docs/zh/introduction/concepts/incompatible-changes.md
index d7006012de..adbb8c4425 100644
--- a/docs/zh/introduction/concepts/incompatible-changes.md
+++ b/docs/zh/introduction/concepts/incompatible-changes.md
@@ -4,6 +4,13 @@
## dev
+### 文件连接器:ORC ZSTD 输出需要兼容的读取器
+
+- **影响组件**:`connector-file-base` 及使用其 ORC 读写实现的文件连接器。
+- **变更说明**:`orc-core:nohive` 从 1.5.6 升级为 1.8.7,共享 ORC sink 配置规则接受 ZSTD,并将 ZSTD
映射为 ORC `CompressionKind.ZSTD`。现在可以读取 ZSTD 压缩的 ORC 文件,且 `compress_codec =
"zstd"` 会实际生成 ZSTD 压缩文件,而不是映射为 NONE。此前,文件工厂会在配置校验阶段拒绝
ORC/ZSTD;绕过该规则的调用路径则可能静默生成未压缩文件。
+- **兼容性影响**:新生成的 ZSTD 文件要求下游读取器支持 ORC ZSTD。保留 ORC 文件版本 0.12
并不能让旧读取器支持该压缩格式。已有文件不会被重写,默认压缩仍为 NONE。
+- **迁移指南**:启用 ORC ZSTD 前先验证或升级下游读取器。分阶段升级期间,可显式保留双方均支持的 SNAPPY 或 ZLIB 等压缩格式。
(#13084)
+
### HBase sink:DELETE 行删除映射的数据
`DELETE` 行现在会删除本 sink 映射列簇中不晚于该变更时间戳的所有单元格版本。此前这些行会将旧值作为 Put 写入,未映射列簇仍不受影响。仅投影
rowkey 和版本列时,没有映射列簇,sink 会拒绝 DELETE 行。请在投影中包含目标列簇的至少一个数据列。
diff --git a/seatunnel-connectors-v2/connector-file/connector-file-base/pom.xml
b/seatunnel-connectors-v2/connector-file/connector-file-base/pom.xml
index e0b1fc3cf8..7da8a6013d 100644
--- a/seatunnel-connectors-v2/connector-file/connector-file-base/pom.xml
+++ b/seatunnel-connectors-v2/connector-file/connector-file-base/pom.xml
@@ -30,7 +30,7 @@
<name>SeaTunnel : Connectors V2 : File : Base</name>
<properties>
- <orc.version>1.5.6</orc.version>
+ <orc.version>1.8.7</orc.version>
<commons.collecton4.version>4.4</commons.collecton4.version>
<commons.lang3.version>3.18.0</commons.lang3.version>
<parquet-avro.version>1.12.3</parquet-avro.version>
@@ -107,6 +107,14 @@
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client-runtime</artifactId>
+ </exclusion>
</exclusions>
</dependency>
diff --git
a/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/CompressFormat.java
b/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/CompressFormat.java
index 5276a80619..ac57ec8b65 100644
---
a/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/CompressFormat.java
+++
b/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/CompressFormat.java
@@ -30,14 +30,14 @@ public enum CompressFormat implements Serializable {
NONE("", CompressionKind.NONE, CompressionCodecName.UNCOMPRESSED),
SNAPPY(".snappy", CompressionKind.SNAPPY, CompressionCodecName.SNAPPY),
LZ4(".lz4", CompressionKind.LZ4, CompressionCodecName.LZ4),
+ ZSTD(".zstd", CompressionKind.ZSTD, CompressionCodecName.ZSTD),
// only orc support
ZLIB(".zlib", CompressionKind.ZLIB, CompressionCodecName.UNCOMPRESSED),
// only parquet support
GZIP(".gz", CompressionKind.NONE, CompressionCodecName.GZIP),
- BROTLI(".br", CompressionKind.NONE, CompressionCodecName.BROTLI),
- ZSTD(".zstd", CompressionKind.NONE, CompressionCodecName.ZSTD);
+ BROTLI(".br", CompressionKind.NONE, CompressionCodecName.BROTLI);
private final String compressCodec;
private final CompressionKind orcCompression;
diff --git
a/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileBaseSinkOptions.java
b/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileBaseSinkOptions.java
index ef89f84153..99663eb1e2 100644
---
a/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileBaseSinkOptions.java
+++
b/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/FileBaseSinkOptions.java
@@ -91,7 +91,8 @@ public class FileBaseSinkOptions extends FileBaseOptions {
CompressFormat.LZO,
CompressFormat.SNAPPY,
CompressFormat.LZ4,
- CompressFormat.ZLIB))
+ CompressFormat.ZLIB,
+ CompressFormat.ZSTD))
.defaultValue(CompressFormat.NONE)
.withDescription("Orc file supported compression");
diff --git
a/seatunnel-connectors-v2/connector-file/connector-file-base/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/writer/OrcWriteStrategyTest.java
b/seatunnel-connectors-v2/connector-file/connector-file-base/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/writer/OrcWriteStrategyTest.java
index bf8bb5a4cd..32db1d802d 100644
---
a/seatunnel-connectors-v2/connector-file/connector-file-base/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/writer/OrcWriteStrategyTest.java
+++
b/seatunnel-connectors-v2/connector-file/connector-file-base/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/writer/OrcWriteStrategyTest.java
@@ -22,9 +22,11 @@ import org.apache.seatunnel.api.source.Collector;
import org.apache.seatunnel.api.table.catalog.CatalogTableUtil;
import org.apache.seatunnel.api.table.type.BasicType;
import org.apache.seatunnel.api.table.type.DecimalType;
+import org.apache.seatunnel.api.table.type.LocalTimeType;
import org.apache.seatunnel.api.table.type.SeaTunnelDataType;
import org.apache.seatunnel.api.table.type.SeaTunnelRow;
import org.apache.seatunnel.api.table.type.SeaTunnelRowType;
+import org.apache.seatunnel.connectors.seatunnel.file.config.CompressFormat;
import org.apache.seatunnel.connectors.seatunnel.file.config.FileFormat;
import
org.apache.seatunnel.connectors.seatunnel.file.exception.FileConnectorException;
import
org.apache.seatunnel.connectors.seatunnel.file.sink.config.FileSinkConfig;
@@ -32,18 +34,36 @@ import
org.apache.seatunnel.connectors.seatunnel.file.sink.writer.OrcWriteStrate
import
org.apache.seatunnel.connectors.seatunnel.file.source.reader.OrcReadStrategy;
import org.apache.seatunnel.connectors.seatunnel.file.util.LocalFileSystemConf;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FSDataInputStream;
+import org.apache.hadoop.fs.RawLocalFileSystem;
+import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.orc.OrcFile;
+import org.apache.orc.Reader;
+
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
+import org.junit.jupiter.api.io.TempDir;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
import lombok.extern.slf4j.Slf4j;
+import java.io.IOException;
+import java.io.OutputStream;
import java.math.BigDecimal;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardOpenOption;
+import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
import static
org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_DEFAULT_NAME_DEFAULT;
@@ -52,6 +72,106 @@ public class OrcWriteStrategyTest {
private static final String TMP_PATH =
"file:///tmp/seatunnel/orc/batch/test";
private static final int ORC_WRITE_NUMBER = 2000;
+ @Test
+ public void testZstdCompressionMapping() {
+ Assertions.assertEquals("ZSTD",
CompressFormat.ZSTD.getOrcCompression().name());
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = {"ZSTD", "SNAPPY", "NONE", "ZLIB", "LZ4"})
+ public void testOrcCompressionRoundTrip(String codec, @TempDir Path
directory)
+ throws Exception {
+ String tmpPath = directory.resolve("pending").toUri().toString();
+ Map<String, Object> config = new HashMap<>();
+ config.put("tmp_path", tmpPath);
+ config.put("path", directory.resolve("output").toUri().toString());
+ config.put("file_format_type", FileFormat.ORC.name());
+ config.put("compress_codec", codec);
+ SeaTunnelRowType rowType =
+ new SeaTunnelRowType(
+ new String[] {"id", "name", "amount", "created_at"},
+ new SeaTunnelDataType[] {
+ BasicType.INT_TYPE,
+ BasicType.STRING_TYPE,
+ new DecimalType(10, 2),
+ LocalTimeType.LOCAL_DATE_TIME_TYPE
+ });
+ LocalDateTime timestamp = LocalDateTime.of(2026, 10, 21, 12, 34, 56,
123456789);
+ LocalFileSystemConf.LocalConf hadoopConf =
+ new LocalFileSystemConf.LocalConf(FS_DEFAULT_NAME_DEFAULT) {
+ @Override
+ public String getFsHdfsImpl() {
+ return JavaLocalFileSystem.class.getName();
+ }
+ };
+ OrcWriteStrategy writer =
+ new OrcWriteStrategy(new
FileSinkConfig(ReadonlyConfig.fromMap(config), rowType));
+ try {
+ writer.setCatalogTable(
+ CatalogTableUtil.getCatalogTable("test", null, null,
"test", rowType));
+ writer.init(hadoopConf, "compression", "compression", 0);
+ writer.beginTransaction(1L);
+ writer.write(
+ new SeaTunnelRow(
+ new Object[] {1, "alpha", new
BigDecimal("123.45"), timestamp}));
+ writer.write(new SeaTunnelRow(new Object[] {2, "\u4e2d\u6587",
null, null}));
+ writer.write(
+ new SeaTunnelRow(new Object[] {3, null, new
BigDecimal("-0.01"), timestamp}));
+ writer.finishAndCloseFile();
+ } finally {
+ writer.close();
+ }
+
+ OrcReadStrategy reader = new OrcReadStrategy();
+ try {
+ reader.init(hadoopConf);
+ List<String> files;
+ try (Stream<Path> paths = Files.walk(directory)) {
+ files =
+ paths.filter(path -> path.toString().endsWith(".orc"))
+ .map(path -> path.toUri().toString())
+ .collect(Collectors.toList());
+ }
+ Assertions.assertEquals(1, files.size());
+ String file = files.get(0);
+ // A round trip alone would also pass when ZSTD is silently mapped
to NONE.
+ try (Reader footer =
+ OrcFile.createReader(
+ new org.apache.hadoop.fs.Path(file),
+ OrcFile.readerOptions(new Configuration()))) {
+ Assertions.assertEquals(codec,
footer.getCompressionKind().name());
+ Assertions.assertEquals(3, footer.getNumberOfRows());
+ }
+ Assertions.assertEquals(rowType,
reader.getSeaTunnelRowTypeInfo(file));
+ List<SeaTunnelRow> rows = new ArrayList<>();
+ reader.read(
+ file,
+ "test",
+ new Collector<SeaTunnelRow>() {
+ @Override
+ public void collect(SeaTunnelRow record) {
+ rows.add(record);
+ }
+
+ @Override
+ public Object getCheckpointLock() {
+ return null;
+ }
+ });
+ Assertions.assertEquals(3, rows.size());
+ Assertions.assertArrayEquals(
+ new Object[] {1, "alpha", new BigDecimal("123.45"),
timestamp},
+ rows.get(0).getFields());
+ Assertions.assertArrayEquals(
+ new Object[] {2, "\u4e2d\u6587", null, null},
rows.get(1).getFields());
+ Assertions.assertArrayEquals(
+ new Object[] {3, null, new BigDecimal("-0.01"), timestamp},
+ rows.get(2).getFields());
+ } finally {
+ reader.close();
+ }
+ }
+
@Test
public void testOrcStructSchemaPreservesFieldCase() {
SeaTunnelRowType structType =
@@ -246,6 +366,56 @@ public class OrcWriteStrategyTest {
};
}
+ /** Uses real local files without requiring Hadoop's native Windows
permission utilities. */
+ public static class JavaLocalFileSystem extends RawLocalFileSystem {
+ private final List<FSDataInputStream> inputs = new ArrayList<>();
+
+ @Override
+ public FSDataInputStream open(org.apache.hadoop.fs.Path path, int
bufferSize)
+ throws IOException {
+ FSDataInputStream input = super.open(path, bufferSize);
+ inputs.add(input);
+ return input;
+ }
+
+ @Override
+ public void close() throws IOException {
+ try {
+ for (FSDataInputStream input : inputs) {
+ input.close();
+ }
+ } finally {
+ super.close();
+ }
+ }
+
+ @Override
+ public boolean mkdirs(org.apache.hadoop.fs.Path path) throws
IOException {
+ Files.createDirectories(pathToFile(path).toPath());
+ return true;
+ }
+
+ @Override
+ public boolean mkdirs(org.apache.hadoop.fs.Path path, FsPermission
permission)
+ throws IOException {
+ Files.createDirectories(pathToFile(path).toPath());
+ return true;
+ }
+
+ @Override
+ protected OutputStream createOutputStreamWithMode(
+ org.apache.hadoop.fs.Path path, boolean overwrite,
FsPermission permission)
+ throws IOException {
+ if (overwrite) {
+ return Files.newOutputStream(pathToFile(path).toPath());
+ }
+ return Files.newOutputStream(
+ pathToFile(path).toPath(),
+ StandardOpenOption.CREATE_NEW,
+ StandardOpenOption.WRITE);
+ }
+ }
+
@DisabledOnOs(OS.WINDOWS)
@Test
public void
testOrcDecimalThatDoesNotFitTheColumnFailsInsteadOfBeingWrittenAsNull()
diff --git
a/seatunnel-connectors-v2/connector-file/connector-file-local/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/local/LocalFileFactoryTest.java
b/seatunnel-connectors-v2/connector-file/connector-file-local/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/local/LocalFileFactoryTest.java
index 8ea1c03b49..393c10f13e 100644
---
a/seatunnel-connectors-v2/connector-file/connector-file-local/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/local/LocalFileFactoryTest.java
+++
b/seatunnel-connectors-v2/connector-file/connector-file-local/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/local/LocalFileFactoryTest.java
@@ -22,13 +22,17 @@ import
org.apache.seatunnel.api.configuration.util.ConfigValidator;
import org.apache.seatunnel.api.configuration.util.OptionRule;
import org.apache.seatunnel.api.configuration.util.OptionValidationException;
import org.apache.seatunnel.api.configuration.util.RequiredOption;
+import org.apache.seatunnel.connectors.seatunnel.file.config.CompressFormat;
import org.apache.seatunnel.connectors.seatunnel.file.config.FileBaseOptions;
+import
org.apache.seatunnel.connectors.seatunnel.file.config.FileBaseSinkOptions;
import
org.apache.seatunnel.connectors.seatunnel.file.config.FileBaseSourceOptions;
import
org.apache.seatunnel.connectors.seatunnel.file.local.sink.LocalFileSinkFactory;
import
org.apache.seatunnel.connectors.seatunnel.file.local.source.LocalFileSourceFactory;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
import java.util.Collections;
import java.util.HashMap;
@@ -37,6 +41,52 @@ import java.util.Map;
class LocalFileFactoryTest {
+ @ParameterizedTest
+ @ValueSource(strings = {"NONE", "LZO", "SNAPPY", "LZ4", "ZLIB", "ZSTD",
"zstd"})
+ void orcSinkAcceptsSupportedCompression(String codec) {
+ Map<String, Object> config = sinkConfig("orc", codec);
+ Assertions.assertDoesNotThrow(
+ () -> validate(config, new
LocalFileSinkFactory().optionRule()));
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = {"GZIP", "BROTLI"})
+ void orcSinkRejectsUnsupportedCompression(String codec) {
+ Assertions.assertThrows(
+ OptionValidationException.class,
+ () -> validate(sinkConfig("orc", codec), new
LocalFileSinkFactory().optionRule()));
+ }
+
+ @Test
+ void compressionDefaultsAndOtherFormatsAreUnchanged() {
+ Map<String, Object> config = sinkConfig("orc", "NONE");
+ config.remove(FileBaseSinkOptions.COMPRESS_CODEC.key());
+ Assertions.assertDoesNotThrow(
+ () -> validate(config, new
LocalFileSinkFactory().optionRule()));
+ Assertions.assertEquals(
+ CompressFormat.NONE,
+
ReadonlyConfig.fromMap(config).get(FileBaseSinkOptions.COMPRESS_CODEC));
+ Assertions.assertDoesNotThrow(
+ () ->
+ validate(
+ sinkConfig("parquet", "ZSTD"),
+ new LocalFileSinkFactory().optionRule()));
+ Assertions.assertThrows(
+ OptionValidationException.class,
+ () ->
+ validate(
+ sinkConfig("text", "ZSTD"),
+ new LocalFileSinkFactory().optionRule()));
+ }
+
+ private static Map<String, Object> sinkConfig(String format, String codec)
{
+ Map<String, Object> config = new HashMap<>();
+ config.put(FileBaseOptions.FILE_PATH.key(), "/sink");
+ config.put(FileBaseSinkOptions.FILE_FORMAT_TYPE.key(), format);
+ config.put(FileBaseSinkOptions.COMPRESS_CODEC.key(), codec);
+ return config;
+ }
+
@Test
void optionRule() {
Assertions.assertNotNull((new LocalFileSinkFactory()).optionRule());
diff --git
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/java/org/apache/seatunnel/e2e/connector/file/local/LocalFileIT.java
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/java/org/apache/seatunnel/e2e/connector/file/local/LocalFileIT.java
index f52639cd01..a2d69a6413 100644
---
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/java/org/apache/seatunnel/e2e/connector/file/local/LocalFileIT.java
+++
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/java/org/apache/seatunnel/e2e/connector/file/local/LocalFileIT.java
@@ -38,12 +38,18 @@ import org.apache.seatunnel.e2e.common.util.JobIdGenerator;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.RawLocalFileSystem;
+import org.apache.orc.CompressionKind;
+import org.apache.orc.OrcFile;
+import org.apache.orc.Reader;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.TestTemplate;
+import org.junit.jupiter.api.io.TempDir;
import org.testcontainers.containers.Container;
import org.testcontainers.containers.GenericContainer;
import
org.testcontainers.shaded.com.github.dockerjava.core.command.ExecStartResultCallback;
@@ -68,6 +74,7 @@ import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.concurrent.CompletableFuture;
@@ -86,6 +93,8 @@ public class LocalFileIT extends TestSuiteBase {
private GenericContainer<?> baseContainer;
+ @TempDir private Path orcCompressionDirectory;
+
/** Copy data files to container */
@TestContainerExtension
private final ContainerExtendedFactory extendedFactory =
@@ -506,6 +515,57 @@ public class LocalFileIT extends TestSuiteBase {
helper.execute("/xml/local_file_xml_to_assert.conf");
}
+ @TestTemplate
+ @DisabledOnContainer(
+ value = {},
+ type = {EngineType.FLINK, EngineType.SPARK},
+ disabledReason =
+ "LocalFile output must be available in the same container
for footer inspection and readback.")
+ public void testLocalFileOrcCompression(TestContainer container)
+ throws IOException, InterruptedException {
+ Configuration configuration = new Configuration();
+ configuration.set("fs.file.impl", RawLocalFileSystem.class.getName());
+ for (String codec : new String[] {"ZSTD", "SNAPPY", "NONE", "ZLIB",
"LZ4"}) {
+ List<String> variables = Arrays.asList("orc_codec=" + codec);
+ Container.ExecResult write =
+
container.executeJob("/orc/local_file_orc_compression.conf", variables);
+ Assertions.assertEquals(0, write.getExitCode(), write.getStderr());
+
+ Container.ExecResult files =
+ baseContainer.execInContainer(
+ "find",
+ "/tmp/seatunnel/orc-compression/" + codec,
+ "-type",
+ "f",
+ "-name",
+ "*.orc");
+ Assertions.assertEquals(0, files.getExitCode(), files.getStderr());
+ Assertions.assertFalse(
+ files.getStdout().trim().isEmpty(), "No ORC output for " +
codec);
+ long rows = 0;
+ int fileIndex = 0;
+ for (String file : files.getStdout().trim().split("\\R")) {
+ Path localFile =
+ orcCompressionDirectory.resolve(codec + "-" +
fileIndex++ + ".orc");
+ baseContainer.copyFileFromContainer(file,
localFile.toString());
+ try (Reader reader =
+ OrcFile.createReader(
+ new
org.apache.hadoop.fs.Path(localFile.toUri()),
+ OrcFile.readerOptions(configuration))) {
+ Assertions.assertEquals(
+ CompressionKind.valueOf(codec),
reader.getCompressionKind());
+ rows += reader.getNumberOfRows();
+ }
+ }
+ Assertions.assertEquals(5L, rows, "Unexpected ORC row count for "
+ codec);
+
+ Container.ExecResult read =
+ container.executeJob(
+ "/orc/local_file_orc_compression_to_assert.conf",
variables);
+ Assertions.assertEquals(0, read.getExitCode(), read.getStderr());
+ }
+ }
+
@TestTemplate
public void testLocalFileCompressed(TestContainer container)
throws IOException, InterruptedException {
diff --git
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/resources/orc/local_file_orc_compression.conf
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/resources/orc/local_file_orc_compression.conf
new file mode 100644
index 0000000000..6f33b58ce7
--- /dev/null
+++
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/resources/orc/local_file_orc_compression.conf
@@ -0,0 +1,37 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+env {
+ parallelism = 1
+ job.mode = "BATCH"
+}
+
+source {
+ LocalFile {
+ path = "/seatunnel/read/orc"
+ file_format_type = "orc"
+ }
+}
+
+sink {
+ LocalFile {
+ path = "/tmp/seatunnel/orc-compression/${orc_codec}"
+ file_format_type = "orc"
+ compress_codec = "${orc_codec}"
+ data_save_mode = "DROP_DATA"
+ }
+}
diff --git
a/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/resources/orc/local_file_orc_compression_to_assert.conf
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/resources/orc/local_file_orc_compression_to_assert.conf
new file mode 100644
index 0000000000..47def80006
--- /dev/null
+++
b/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/resources/orc/local_file_orc_compression_to_assert.conf
@@ -0,0 +1,46 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+env {
+ parallelism = 1
+ job.mode = "BATCH"
+}
+
+source {
+ LocalFile {
+ path = "/tmp/seatunnel/orc-compression/${orc_codec}"
+ file_format_type = "orc"
+ }
+}
+
+sink {
+ Assert {
+ rules {
+ row_rules = [
+ { rule_type = MIN_ROW, rule_value = 5 },
+ { rule_type = MAX_ROW, rule_value = 5 }
+ ]
+ field_rules = [
+ {
+ field_name = c_string
+ field_type = string
+ field_value = [{ rule_type = NOT_NULL }]
+ }
+ ]
+ }
+ }
+}