This is an automated email from the ASF dual-hosted git repository. fanjia 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 92aa855a34 [Improve][File] Add row_delimiter options into text file sink (#9017) 92aa855a34 is described below commit 92aa855a34df072cc2256fbe101830bd9b1d826f Author: hailin0 <wanghai...@apache.org> AuthorDate: Fri Mar 21 13:49:30 2025 +0800 [Improve][File] Add row_delimiter options into text file sink (#9017) --- docs/en/connector-v2/sink/CosFile.md | 4 +- docs/en/connector-v2/sink/FtpFile.md | 4 +- docs/en/connector-v2/sink/HdfsFile.md | 2 +- docs/en/connector-v2/sink/LocalFile.md | 4 +- docs/en/connector-v2/sink/ObsFile.md | 2 +- docs/en/connector-v2/sink/OssFile.md | 6 +- docs/en/connector-v2/sink/OssJindoFile.md | 4 +- docs/en/connector-v2/sink/S3File.md | 4 +- docs/en/connector-v2/sink/SftpFile.md | 4 +- docs/zh/connector-v2/sink/CosFile.md | 4 +- docs/zh/connector-v2/sink/FtpFile.md | 80 +++++++++++----------- docs/zh/connector-v2/sink/HdfsFile.md | 2 +- docs/zh/connector-v2/sink/LocalFile.md | 4 +- docs/zh/connector-v2/sink/ObsFile.md | 52 +++++++------- docs/zh/connector-v2/sink/OssFile.md | 72 +++++++++---------- docs/zh/connector-v2/sink/OssJindoFile.md | 68 +++++++++--------- docs/zh/connector-v2/sink/S3File.md | 4 +- docs/zh/connector-v2/sink/SftpFile.md | 76 ++++++++++---------- .../seatunnel/file/config/BaseSinkConfig.java | 2 +- .../file/cos/sink/CosFileSinkFactory.java | 2 + .../file/ftp/sink/FtpFileSinkFactory.java | 2 + .../file/hdfs/sink/HdfsFileSinkFactory.java | 2 + .../file/oss/jindo/sink/OssFileSinkFactory.java | 2 + .../file/local/sink/LocalFileSinkFactory.java | 2 + .../file/obs/sink/ObsFileSinkFactory.java | 2 + .../file/oss/sink/OssFileSinkFactory.java | 2 + .../seatunnel/file/s3/sink/S3FileSinkFactory.java | 2 + .../file/sftp/sink/SftpFileSinkFactory.java | 2 + 28 files changed, 217 insertions(+), 199 deletions(-) diff --git a/docs/en/connector-v2/sink/CosFile.md b/docs/en/connector-v2/sink/CosFile.md index 356eed4446..5fbdfa133f 100644 --- a/docs/en/connector-v2/sink/CosFile.md +++ b/docs/en/connector-v2/sink/CosFile.md @@ -50,7 +50,7 @@ By default, we use 2PC commit to ensure `exactly-once` | file_format_type | string | no | "csv" | | | filename_extension | string | no | - | Override the default file name extensions with custom file name extensions. E.g. `.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | no | '\001' | Only used when file_format is text | -| row_delimiter | string | no | "\n" | Only used when file_format is text | +| row_delimiter | string | no | "\n" | Only used when file_format is `text`, `csv` and `json` | | have_partition | boolean | no | false | Whether you need processing partitions. | | partition_by | array | no | - | Only used then have_partition is true | | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used then have_partition is true | @@ -134,7 +134,7 @@ The separator between columns in a row of data. Only needed by `text` file forma ### row_delimiter [string] -The separator between rows in a file. Only needed by `text` file format. +The separator between rows in a file. Only needed by `text`, `csv` and `json` file format. ### have_partition [boolean] diff --git a/docs/en/connector-v2/sink/FtpFile.md b/docs/en/connector-v2/sink/FtpFile.md index ec8447ad47..3ac9a26edb 100644 --- a/docs/en/connector-v2/sink/FtpFile.md +++ b/docs/en/connector-v2/sink/FtpFile.md @@ -49,7 +49,7 @@ By default, we use 2PC commit to ensure `exactly-once` | file_format_type | string | no | "csv" | | | filename_extension | string | no | - | Override the default file name extensions with custom file name extensions. E.g. `.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | no | '\001' | Only used when file_format_type is text | -| row_delimiter | string | no | "\n" | Only used when file_format_type is text | +| row_delimiter | string | no | "\n" | Only used when file_format_type is `text`, `csv` and `json` | | have_partition | boolean | no | false | Whether you need processing partitions. | | partition_by | array | no | - | Only used then have_partition is true | | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used then have_partition is true | @@ -142,7 +142,7 @@ The separator between columns in a row of data. Only needed by `text` file forma ### row_delimiter [string] -The separator between rows in a file. Only needed by `text` file format. +The separator between rows in a file. Only needed by `text`, `csv` and `json` file format. ### have_partition [boolean] diff --git a/docs/en/connector-v2/sink/HdfsFile.md b/docs/en/connector-v2/sink/HdfsFile.md index 8cd9973a04..62e4ebc0aa 100644 --- a/docs/en/connector-v2/sink/HdfsFile.md +++ b/docs/en/connector-v2/sink/HdfsFile.md @@ -52,7 +52,7 @@ Output data to hdfs file | file_format_type | string | no | "csv" | We supported as the following file types:`text` `csv` `parquet` `orc` `json` `excel` `xml` `binary`.Please note that, The final file name will end with the file_format's suffix, the suffix of the text file is `txt`. [...] | filename_extension | string | no | - | Override the default file name extensions with custom file name extensions. E.g. `.xml`, `.json`, `dat`, `.customtype` [...] | field_delimiter | string | no | '\001' | Only used when file_format is text,The separator between columns in a row of data. Only needed by `text` file format. [...] -| row_delimiter | string | no | "\n" | Only used when file_format is text,The separator between rows in a file. Only needed by `text` file format. [...] +| row_delimiter | string | no | "\n" | Only used when file_format is text,The separator between rows in a file. Only needed by `text`, `csv` and `json` file format. [...] | have_partition | boolean | no | false | Whether you need processing partitions. [...] | partition_by | array | no | - | Only used then have_partition is true,Partition data based on selected fields. [...] | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used then have_partition is true,If the `partition_by` is specified, we will generate the corresponding partition directory based on the partition information, and the final file will be placed in the partition directory. Default `partition_dir_expression` is `${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/`. `k0` is the first partition field and `v0` is the value of the first partit [...] diff --git a/docs/en/connector-v2/sink/LocalFile.md b/docs/en/connector-v2/sink/LocalFile.md index 8ee8114bac..22fa222a81 100644 --- a/docs/en/connector-v2/sink/LocalFile.md +++ b/docs/en/connector-v2/sink/LocalFile.md @@ -45,7 +45,7 @@ By default, we use 2PC commit to ensure `exactly-once` | file_format_type | string | no | "csv" | | | filename_extension | string | no | - | Override the default file name extensions with custom file name extensions. E.g. `.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | no | '\001' | Only used when file_format_type is text | -| row_delimiter | string | no | "\n" | Only used when file_format_type is text | +| row_delimiter | string | no | "\n" | Only used when file_format_type is `text`, `csv` and `json` | | have_partition | boolean | no | false | Whether you need processing partitions. | | partition_by | array | no | - | Only used then have_partition is true | | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used then have_partition is true | @@ -116,7 +116,7 @@ The separator between columns in a row of data. Only needed by `text` file forma ### row_delimiter [string] -The separator between rows in a file. Only needed by `text` file format. +The separator between rows in a file. Only needed by `text`, `json` and `json` file format. ### have_partition [boolean] diff --git a/docs/en/connector-v2/sink/ObsFile.md b/docs/en/connector-v2/sink/ObsFile.md index 475e8db499..e182e951c8 100644 --- a/docs/en/connector-v2/sink/ObsFile.md +++ b/docs/en/connector-v2/sink/ObsFile.md @@ -64,7 +64,7 @@ It only supports hadoop version **2.9.X+**. | filename_time_format | string | no | "yyyy.MM.dd" | Specify the time format of the `path`. Only used when custom_filename is true. [Tips](#filename_time_format) | | file_format_type | string | no | "csv" | Supported file types. [Tips](#file_format_type) | | field_delimiter | string | no | '\001' | The separator between columns in a row of data.Only used when file_format is text. | -| row_delimiter | string | no | "\n" | The separator between rows in a file. Only needed by `text` file format. | +| row_delimiter | string | no | "\n" | The separator between rows in a file. Only needed by `text`, `csv` and `json` file format. | | have_partition | boolean | no | false | Whether you need processing partitions. | | partition_by | array | no | - | Partition data based on selected fields. Only used then have_partition is true. | | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used then have_partition is true.[Tips](#partition_dir_expression) | diff --git a/docs/en/connector-v2/sink/OssFile.md b/docs/en/connector-v2/sink/OssFile.md index df3c4f2870..6974118065 100644 --- a/docs/en/connector-v2/sink/OssFile.md +++ b/docs/en/connector-v2/sink/OssFile.md @@ -40,7 +40,7 @@ By default, we use 2PC commit to ensure `exactly-once` ## Data Type Mapping -If write to `csv`, `text` file type, All column will be string. +If write to `csv`, `text`, `json` file type, All column will be string. ### Orc File Type @@ -102,7 +102,7 @@ If write to `csv`, `text` file type, All column will be string. | file_format_type | string | no | "csv" | | | filename_extension | string | no | - | Override the default file name extensions with custom file name extensions. E.g. `.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | no | '\001' | Only used when file_format_type is text | -| row_delimiter | string | no | "\n" | Only used when file_format_type is text | +| row_delimiter | string | no | "\n" | Only used when file_format_type is `text`, `csv` and `json` | | have_partition | boolean | no | false | Whether you need processing partitions. | | partition_by | array | no | - | Only used then have_partition is true | | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used then have_partition is true | @@ -187,7 +187,7 @@ The separator between columns in a row of data. Only needed by `text` file forma ### row_delimiter [string] -The separator between rows in a file. Only needed by `text` file format. +The separator between rows in a file. Only needed by `text`, `csv` and `json` file format. ### have_partition [boolean] diff --git a/docs/en/connector-v2/sink/OssJindoFile.md b/docs/en/connector-v2/sink/OssJindoFile.md index e3b23baaa1..a0b73c2bc2 100644 --- a/docs/en/connector-v2/sink/OssJindoFile.md +++ b/docs/en/connector-v2/sink/OssJindoFile.md @@ -54,7 +54,7 @@ By default, we use 2PC commit to ensure `exactly-once` | file_format_type | string | no | "csv" | | | filename_extension | string | no | - | Override the default file name extensions with custom file name extensions. E.g. `.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | no | '\001' | Only used when file_format_type is text | -| row_delimiter | string | no | "\n" | Only used when file_format_type is text | +| row_delimiter | string | no | "\n" | Only used when file_format_type is `text`, `csv` and `json` | | have_partition | boolean | no | false | Whether you need processing partitions. | | partition_by | array | no | - | Only used then have_partition is true | | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used then have_partition is true | @@ -138,7 +138,7 @@ The separator between columns in a row of data. Only needed by `text` file forma ### row_delimiter [string] -The separator between rows in a file. Only needed by `text` file format. +The separator between rows in a file. Only needed by `text`, `csv` and `json` file format. ### have_partition [boolean] diff --git a/docs/en/connector-v2/sink/S3File.md b/docs/en/connector-v2/sink/S3File.md index d434ecf563..0e817d1890 100644 --- a/docs/en/connector-v2/sink/S3File.md +++ b/docs/en/connector-v2/sink/S3File.md @@ -110,7 +110,7 @@ If write to `csv`, `text` file type, All column will be string. | file_format_type | string | no | "csv" | | | filename_extension | string | no | - | Override the default file name extensions with custom file name extensions. E.g. `.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | no | '\001' | Only used when file_format is text | -| row_delimiter | string | no | "\n" | Only used when file_format is text | +| row_delimiter | string | no | "\n" | Only used when file_format is `text`, `csv` and `json` | | have_partition | boolean | no | false | Whether you need processing partitions. | | partition_by | array | no | - | Only used when have_partition is true | | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used when have_partition is true | @@ -193,7 +193,7 @@ The separator between columns in a row of data. Only needed by `text` file forma ### row_delimiter [string] -The separator between rows in a file. Only needed by `text` file format. +The separator between rows in a file. Only needed by `text`, `csv` and `json` file format. ### have_partition [boolean] diff --git a/docs/en/connector-v2/sink/SftpFile.md b/docs/en/connector-v2/sink/SftpFile.md index 3cc4a382b8..a4a4b09d8e 100644 --- a/docs/en/connector-v2/sink/SftpFile.md +++ b/docs/en/connector-v2/sink/SftpFile.md @@ -48,7 +48,7 @@ By default, we use 2PC commit to ensure `exactly-once` | file_format_type | string | no | "csv" | | | filename_extension | string | no | - | Override the default file name extensions with custom file name extensions. E.g. `.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | no | '\001' | Only used when file_format_type is text | -| row_delimiter | string | no | "\n" | Only used when file_format_type is text | +| row_delimiter | string | no | "\n" | Only used when file_format_type is `text`, `csv` and `json` | | have_partition | boolean | no | false | Whether you need processing partitions. | | partition_by | array | no | - | Only used then have_partition is true | | partition_dir_expression | string | no | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | Only used then have_partition is true | @@ -135,7 +135,7 @@ The separator between columns in a row of data. Only needed by `text` file forma ### row_delimiter [string] -The separator between rows in a file. Only needed by `text` file format. +The separator between rows in a file. Only needed by `text`, `csv` and `json` file format. ### have_partition [boolean] diff --git a/docs/zh/connector-v2/sink/CosFile.md b/docs/zh/connector-v2/sink/CosFile.md index cea0f34a74..3171e9b1a7 100644 --- a/docs/zh/connector-v2/sink/CosFile.md +++ b/docs/zh/connector-v2/sink/CosFile.md @@ -50,7 +50,7 @@ import ChangeLog from '../changelog/connector-file-cos.md'; | file_format_type | string | 否 | "csv" | | | filename_extension | string | 否 | - | 使用自定义的文件扩展名覆盖默认的文件扩展名。 例如:`.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | 否 | '\001' | 仅在file_format为text时使用 | -| row_delimiter | string | 否 | "\n" | 仅在file_format为text时使用 | +| row_delimiter | string | 否 | "\n" | 仅在file_format为 `text`、`csv`、`json` 时使用 | | have_partition | boolean | 否 | false | 是否需要处理分区. | | partition_by | array | 否 | - | 只有在have_partition为true时才使用 | | partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为true时才使用 | @@ -134,7 +134,7 @@ cos文件系统的分区. ### row_delimiter [string] -文件中行之间的分隔符. 只需要 `text` 文件格式. +文件中行之间的分隔符. 只需要 `text`、`csv`、`json` 文件格式. ### have_partition [boolean] diff --git a/docs/zh/connector-v2/sink/FtpFile.md b/docs/zh/connector-v2/sink/FtpFile.md index 8023c16cf3..af7e3c1220 100644 --- a/docs/zh/connector-v2/sink/FtpFile.md +++ b/docs/zh/connector-v2/sink/FtpFile.md @@ -33,45 +33,45 @@ import ChangeLog from '../changelog/connector-file-ftp.md'; - [x] binary ## 选项 -| 名称 | 类型 | 是否必须 | 默认值 | 描述 | -|---------------------------------------|---------|------------|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| host | string | 是 | - | | -| port | int | 是 | - | | -| user | string | 是 | - | | -| password | string | 是 | - | | -| path | string | 是 | - | | -| tmp_path | string | 是 | /tmp/seatunnel | 结果文件将首先写入一个临时路径,然后使用 `mv` 命令将临时目录提交到目标目录。需要是一个FTP目录。 | -| connection_mode | string | 否 | active_local | 目标FTP连接模式 | -| custom_filename | boolean | 否 | false | 是否需要自定义文件名 | -| file_name_expression | string | 否 | "${transactionId}" | 仅在 `custom_filename` 为 `true` 时使用 | -| filename_time_format | string | 否 | "yyyy.MM.dd" | 仅在 `custom_filename` 为 `true` 时使用 | -| file_format_type | string | 否 | "csv" | | -| filename_extension | string | 否 | - | 用自定义的文件扩展名覆盖默认的文件扩展名。例如:`.xml`、`.json`、`dat`、`.customtype` | -| field_delimiter | string | 否 | '\001' | 仅在 `file_format_type` 为 `text` 时使用 | -| row_delimiter | string | 否 | "\n" | 仅在 `file_format_type` 为 `text` 时使用 | -| have_partition | boolean | 否 | false | 是否需要处理分区。 | -| partition_by | array | 否 | - | 仅在 `have_partition` 为 `true` 时使用 | -| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 仅在 `have_partition` 为 `true` 时使用 | -| is_partition_field_write_in_file | boolean | 否 | false | 仅在 `have_partition` 为 `true` 时使用 | -| sink_columns | array | 否 | | 当此参数为空时,所有字段都是要写入的列 | -| is_enable_transaction | boolean | 否 | true | | -| batch_size | int | 否 | 1000000 | | -| compress_codec | string | 否 | none | | -| common-options | object | 否 | - | | -| max_rows_in_memory | int | 否 | - | 仅在 `file_format_type` 为 `excel` 时使用。 | -| sheet_name | string | 否 | Sheet${随机数} | 仅在 `file_format_type` 为 `excel` 时使用。 | -| csv_string_quote_mode | enum | 否 | MINIMAL | 仅在 `file_format` 为 `csv` 时使用。 | -| xml_root_tag | string | 否 | RECORDS | 仅在 `file_format` 为 `xml` 时使用。 | -| xml_row_tag | string | 否 | RECORD | 仅在 `file_format` 为 `xml` 时使用。 | -| xml_use_attr_format | boolean | 否 | - | 仅在 `file_format` 为 `xml` 时使用。 | -| single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。当此参数开启时,`batch_size` 将不会生效。输出文件名不会有文件分块后缀。 | -| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | -| parquet_avro_write_timestamp_as_int96 | boolean | 否 | false | 仅在 `file_format` 为 `parquet` 时使用。 | -| parquet_avro_write_fixed_as_int96 | array | 否 | - | 仅在 `file_format` 为 `parquet` 时使用。 | -| enable_header_write | boolean | 否 | false | 仅在 `file_format_type` 为 `text`、`csv` 时使用。<br/> `false`:不写入表头,`true`:写入表头。 | -| encoding | string | 否 | "UTF-8" | 仅在 `file_format_type` 为 `json`、`text`、`csv`、`xml` 时使用。 | -| schema_save_mode | string | 否 | CREATE_SCHEMA_WHEN_NOT_EXIST | 现有目录处理方法 | -| data_save_mode | string | 否 | APPEND_DATA | 现有数据处理方法 | +| 名称 | 类型 | 是否必须 | 默认值 | 描述 | +|---------------------------------------|---------|------------|--------------------------------------------|---------------------------------------------------------------------------| +| host | string | 是 | - | | +| port | int | 是 | - | | +| user | string | 是 | - | | +| password | string | 是 | - | | +| path | string | 是 | - | | +| tmp_path | string | 是 | /tmp/seatunnel | 结果文件将首先写入一个临时路径,然后使用 `mv` 命令将临时目录提交到目标目录。需要是一个FTP目录。 | +| connection_mode | string | 否 | active_local | 目标FTP连接模式 | +| custom_filename | boolean | 否 | false | 是否需要自定义文件名 | +| file_name_expression | string | 否 | "${transactionId}" | 仅在 `custom_filename` 为 `true` 时使用 | +| filename_time_format | string | 否 | "yyyy.MM.dd" | 仅在 `custom_filename` 为 `true` 时使用 | +| file_format_type | string | 否 | "csv" | | +| filename_extension | string | 否 | - | 用自定义的文件扩展名覆盖默认的文件扩展名。例如:`.xml`、`.json`、`dat`、`.customtype` | +| field_delimiter | string | 否 | '\001' | 仅在 `file_format_type` 为 `text` 时使用 | +| row_delimiter | string | 否 | "\n" | 仅在 `file_format_type` 为 `text`、`csv`、`json` 时使用 | +| have_partition | boolean | 否 | false | 是否需要处理分区。 | +| partition_by | array | 否 | - | 仅在 `have_partition` 为 `true` 时使用 | +| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 仅在 `have_partition` 为 `true` 时使用 | +| is_partition_field_write_in_file | boolean | 否 | false | 仅在 `have_partition` 为 `true` 时使用 | +| sink_columns | array | 否 | | 当此参数为空时,所有字段都是要写入的列 | +| is_enable_transaction | boolean | 否 | true | | +| batch_size | int | 否 | 1000000 | | +| compress_codec | string | 否 | none | | +| common-options | object | 否 | - | | +| max_rows_in_memory | int | 否 | - | 仅在 `file_format_type` 为 `excel` 时使用。 | +| sheet_name | string | 否 | Sheet${随机数} | 仅在 `file_format_type` 为 `excel` 时使用。 | +| csv_string_quote_mode | enum | 否 | MINIMAL | 仅在 `file_format` 为 `csv` 时使用。 | +| xml_root_tag | string | 否 | RECORDS | 仅在 `file_format` 为 `xml` 时使用。 | +| xml_row_tag | string | 否 | RECORD | 仅在 `file_format` 为 `xml` 时使用。 | +| xml_use_attr_format | boolean | 否 | - | 仅在 `file_format` 为 `xml` 时使用。 | +| single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。当此参数开启时,`batch_size` 将不会生效。输出文件名不会有文件分块后缀。 | +| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | +| parquet_avro_write_timestamp_as_int96 | boolean | 否 | false | 仅在 `file_format` 为 `parquet` 时使用。 | +| parquet_avro_write_fixed_as_int96 | array | 否 | - | 仅在 `file_format` 为 `parquet` 时使用。 | +| enable_header_write | boolean | 否 | false | 仅在 `file_format_type` 为 `text`、`csv` 时使用。<br/> `false`:不写入表头,`true`:写入表头。 | +| encoding | string | 否 | "UTF-8" | 仅在 `file_format_type` 为 `json`、`text`、`csv`、`xml` 时使用。 | +| schema_save_mode | string | 否 | CREATE_SCHEMA_WHEN_NOT_EXIST | 现有目录处理方法 | +| data_save_mode | string | 否 | APPEND_DATA | 现有数据处理方法 | ### host [string] @@ -143,7 +143,7 @@ import ChangeLog from '../changelog/connector-file-ftp.md'; ### row_delimiter [string] -一行数据中各列之间的分隔符。仅在`text`文件格式中需要用到。 +一行数据中各列之间的分隔符。仅在 `text`、`csv`、`json` 文件格式中需要用到。 ### have_partition [boolean] diff --git a/docs/zh/connector-v2/sink/HdfsFile.md b/docs/zh/connector-v2/sink/HdfsFile.md index a8312065f1..d0e4b2f520 100644 --- a/docs/zh/connector-v2/sink/HdfsFile.md +++ b/docs/zh/connector-v2/sink/HdfsFile.md @@ -50,7 +50,7 @@ import ChangeLog from '../changelog/connector-file-hadoop.md'; | file_format_type | string | 否 | "csv" | 我们支持以下文件类型:`text` `json` `csv` `orc` `parquet` `excel`。请注意,最终文件名将以文件格式的后缀结束,文本文件的后缀是 `txt`。 | | filename_extension | string | 否 | - | 使用自定义的文件扩展名覆盖默认的文件扩展名。 例如:`.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | 否 | '\001' | 仅在 file_format 为 text 时使用,数据行中列之间的分隔符。仅需要 `text` 文件格式。 | -| row_delimiter | string | 否 | "\n" | 仅在 file_format 为 text 时使用,文件中行之间的分隔符。仅需要 `text` 文件格式。 | +| row_delimiter | string | 否 | "\n" | 仅在 file_format 为 text 时使用,文件中行之间的分隔符。仅需要 `text`、`csv`、`json` 文件格式。 | | have_partition | boolean | 否 | false | 是否需要处理分区。 | | partition_by | array | 否 | - | 仅在 have_partition 为 true 时使用,根据选定的字段对数据进行分区。 | | partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 仅在 have_partition 为 true 时使用,如果指定了 `partition_by`,我们将根据分区信息生成相应的分区目录,并将最终文件放置在分区目录中。默认 `partition_dir_expression` 为 `${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/`。`k0` 是第一个分区字段,`v0` 是第一个分区字段的值。 | diff --git a/docs/zh/connector-v2/sink/LocalFile.md b/docs/zh/connector-v2/sink/LocalFile.md index 1788d07256..e30ffee660 100644 --- a/docs/zh/connector-v2/sink/LocalFile.md +++ b/docs/zh/connector-v2/sink/LocalFile.md @@ -44,7 +44,7 @@ import ChangeLog from '../changelog/connector-file-local.md'; | file_format_type | string | 否 | "csv" | 文件格式类型 | | filename_extension | string | 否 | - | 使用自定义的文件扩展名覆盖默认的文件扩展名。 例如:`.xml`, `.json`, `dat`, `.customtype` | | field_delimiter | string | 否 | '\001' | 仅在 file_format_type 为 text 时使用 | -| row_delimiter | string | 否 | "\n" | 仅在 file_format_type 为 text 时使用 | +| row_delimiter | string | 否 | "\n" | 仅在 file_format_type 为 `text`、`csv`、`json` 时使用 | | have_partition | boolean | 否 | false | 是否需要处理分区 | | partition_by | array | 否 | - | 仅在 have_partition 为 true 时使用 | | partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 仅在 have_partition 为 true 时使用 | @@ -112,7 +112,7 @@ import ChangeLog from '../changelog/connector-file-local.md'; ### row_delimiter [string] -文件中行之间的分隔符。仅在 `text` 文件格式下需要。 +文件中行之间的分隔符。仅在 `text`、`csv`、`json` 文件格式下需要。 ### have_partition [boolean] diff --git a/docs/zh/connector-v2/sink/ObsFile.md b/docs/zh/connector-v2/sink/ObsFile.md index b75f5c6bab..8ddf451021 100644 --- a/docs/zh/connector-v2/sink/ObsFile.md +++ b/docs/zh/connector-v2/sink/ObsFile.md @@ -52,32 +52,32 @@ import ChangeLog from '../changelog/connector-file-obs.md'; ## 参数 -| 名称 | 类型 | 是否必填 | 默认值 | 描述 | -|----------------------------------|---------|---------|--------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------| -| path | string | 是 | - | 目标目录路径。 | -| bucket | string | 是 | - | obs文件系统的bucket地址,例如:`obs://obs-bucket-name`. | -| access_key | string | 是 | - | obs文件系统的访问密钥。 | -| access_secret | string | 是 | - | obs文件系统的访问私钥。 | -| endpoint | string | 是 | - | obs文件系统的终端。 | -| custom_filename | boolean | 否 | false | 是否需要自定义文件名。 | -| file_name_expression | string | 否 | "${transactionId}" | 描述将在“路径”中创建的文件表达式。仅在custom_filename为true时使用。[提示](#file_name_expression) | -| filename_time_format | string | 否 | "yyyy.MM.dd" | 指定“path”的时间格式。仅在custom_filename为true时使用。[提示](#filename_time_format) | -| file_format_type | string | 否 | "csv" | 支持的文件类型。[提示](#file_format_type) | -| field_delimiter | string | 否 | '\001' | 数据行中列之间的分隔符。仅在file_format为文本时使用。 | -| row_delimiter | string | 否 | "\n" | 文件中行之间的分隔符。仅被“text”文件格式需要。 | -| have_partition | boolean | 否 | false | 是否需要处理分区。 | -| partition_by | array | 否 | - | 根据所选字段对数据进行分区。只有在have_partition为true时才使用。 | -| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为真true时才使用。[提示](#partition_dir_expression) | -| is_partition_field_write_in_file | boolean | 否 | false | 只有在have_partition为true时才使用。[提示](#is_partition_field_write_in_file) | -| sink_columns | array | 否 | | 当此参数为空时,所有字段都是接收列。[提示](#sink_columns) | -| is_enable_transaction | boolean | 否 | true | [提示](#is_enable_transaction) | -| batch_size | int | 否 | 1000000 | [提示](#batch_size) | -| single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。启用此参数后,batch_size将不会生效。输出文件名没有文件块后缀。 | -| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | -| compress_codec | string | 否 | none | [提示](#compress_codec) | -| common-options | object | 否 | - | [提示](#common_options) | -| max_rows_in_memory | int | 否 | - | 当文件格式为Excel时,内存中可以缓存的最大数据项数。仅在file_format为excel时使用。 | -| sheet_name | string | 否 | Sheet${Random number} | 标签页。仅在file_format为excel时使用。 | +| 名称 | 类型 | 是否必填 | 默认值 | 描述 | +|----------------------------------|---------|---------|--------------------------------------------|-------------------------------------------------------------------------| +| path | string | 是 | - | 目标目录路径。 | +| bucket | string | 是 | - | obs文件系统的bucket地址,例如:`obs://obs-bucket-name`. | +| access_key | string | 是 | - | obs文件系统的访问密钥。 | +| access_secret | string | 是 | - | obs文件系统的访问私钥。 | +| endpoint | string | 是 | - | obs文件系统的终端。 | +| custom_filename | boolean | 否 | false | 是否需要自定义文件名。 | +| file_name_expression | string | 否 | "${transactionId}" | 描述将在“路径”中创建的文件表达式。仅在custom_filename为true时使用。[提示](#file_name_expression) | +| filename_time_format | string | 否 | "yyyy.MM.dd" | 指定“path”的时间格式。仅在custom_filename为true时使用。[提示](#filename_time_format) | +| file_format_type | string | 否 | "csv" | 支持的文件类型。[提示](#file_format_type) | +| field_delimiter | string | 否 | '\001' | 数据行中列之间的分隔符。仅在file_format为文本时使用。 | +| row_delimiter | string | 否 | "\n" | 文件中行之间的分隔符。仅被 `text`、`csv`、`json` 文件格式需要。 | +| have_partition | boolean | 否 | false | 是否需要处理分区。 | +| partition_by | array | 否 | - | 根据所选字段对数据进行分区。只有在have_partition为true时才使用。 | +| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为真true时才使用。[提示](#partition_dir_expression) | +| is_partition_field_write_in_file | boolean | 否 | false | 只有在have_partition为true时才使用。[提示](#is_partition_field_write_in_file) | +| sink_columns | array | 否 | | 当此参数为空时,所有字段都是接收列。[提示](#sink_columns) | +| is_enable_transaction | boolean | 否 | true | [提示](#is_enable_transaction) | +| batch_size | int | 否 | 1000000 | [提示](#batch_size) | +| single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。启用此参数后,batch_size将不会生效。输出文件名没有文件块后缀。 | +| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | +| compress_codec | string | 否 | none | [提示](#compress_codec) | +| common-options | object | 否 | - | [提示](#common_options) | +| max_rows_in_memory | int | 否 | - | 当文件格式为Excel时,内存中可以缓存的最大数据项数。仅在file_format为excel时使用。 | +| sheet_name | string | 否 | Sheet${Random number} | 标签页。仅在file_format为excel时使用。 | ### 提示 diff --git a/docs/zh/connector-v2/sink/OssFile.md b/docs/zh/connector-v2/sink/OssFile.md index c0fee38dce..9ca9827ca4 100644 --- a/docs/zh/connector-v2/sink/OssFile.md +++ b/docs/zh/connector-v2/sink/OssFile.md @@ -89,41 +89,41 @@ import ChangeLog from '../changelog/connector-file-oss.md'; ## 选项 -| 名称 | 类型 | 必需 | 默认值 | 描述 | -|---------------------------------------|---------|----------|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| path | string | 是 | 写入文件的oss路径。 | | -| tmp_path | string | 否 | /tmp/seatunnel | 结果文件将首先写入tmp路径,然后使用`mv`将tmp-dir提交到目标dir。因此需要一个OSS目录。 | -| bucket | string | 是 | - | | -| access_key | string | 是 | - | | -| access_secret | string | 是 | - | | -| endpoint | string | 是 | - | | -| custom_filename | boolean | 否 | false | 是否需要自定义文件名 | -| file_name_expression | string | 否 | "${transactionId}" | 仅在custom_filename为true时使用 | -| filename_time_format | string | 否 | "yyyy.MM.dd" | 仅在custom_filename为true时使用 | -| file_format_type | string | 否 | "csv" | | -| field_delimiter | string | 否 | '\001' | 仅当file_format_type为文本时使用 | -| row_delimiter | string | 否 | "\n" | 仅当file_format_type为文本时使用 | -| have_partition | boolean | 否 | false | 是否需要处理分区。 | -| partition_by | array | 否 | - | 只有在have_partition为true时才使用 | -| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为true时才使用 | -| is_partition_field_write_in_file | boolean | 否 | false | 只有在have_partition为true时才使用 | -| sink_columns | array | 否 | | 当此参数为空时,所有字段都是接收列 | -| is_enable_transaction | boolean | 否 | true | | -| batch_size | int | 否 | 1000000 | | -| compress_codec | string | 否 | none | | -| common-options | object | 否 | - | | -| max_rows_in_memory | int | 否 | - | 仅当file_format_type为excel时使用。 | -| sheet_name | string | 否 | Sheet${Random number} | 仅当file_format_type为excel时使用。 | -| csv_string_quote_mode | enum | 否 | MINIMAL | 仅在file_format为csv时使用。 | -| xml_root_tag | string | 否 | RECORDS | 仅在file_format为xml时使用。 | -| xml_row_tag | string | 否 | RECORD | 仅在file_format为xml时使用。 | -| xml_use_attr_format | boolean | 否 | - | 仅在file_format为xml时使用。 | -| single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。启用此参数后,batch_size将不会生效。输出文件名没有文件块后缀。 | -| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | -| parquet_avro_write_timestamp_as_int96 | boolean | 否 | false | 仅在file_format为parquet时使用。 | -| parquet_avro_write_fixed_as_int96 | array | 否 | - | 仅在file_format为parquet时使用。 | -| enable_header_write | boolean | 否 | false | 仅当file_format_type为文本、csv时使用<br/>false:不写标头,true:写标头。 | -| encoding | string | 否 | "UTF-8" | 仅当file_format_type为json、text、csv、xml时使用。 | +| 名称 | 类型 | 必需 | 默认值 | 描述 | +|---------------------------------------|---------|----------|--------------------------------------------|-------------------------------------------------------| +| path | string | 是 | 写入文件的oss路径。 | | +| tmp_path | string | 否 | /tmp/seatunnel | 结果文件将首先写入tmp路径,然后使用`mv`将tmp-dir提交到目标dir。因此需要一个OSS目录。 | +| bucket | string | 是 | - | | +| access_key | string | 是 | - | | +| access_secret | string | 是 | - | | +| endpoint | string | 是 | - | | +| custom_filename | boolean | 否 | false | 是否需要自定义文件名 | +| file_name_expression | string | 否 | "${transactionId}" | 仅在custom_filename为true时使用 | +| filename_time_format | string | 否 | "yyyy.MM.dd" | 仅在custom_filename为true时使用 | +| file_format_type | string | 否 | "csv" | | +| field_delimiter | string | 否 | '\001' | 仅当file_format_type为文本时使用 | +| row_delimiter | string | 否 | "\n" | 仅当file_format_type为 `text`、`csv`、`json` 时使用 | +| have_partition | boolean | 否 | false | 是否需要处理分区。 | +| partition_by | array | 否 | - | 只有在have_partition为true时才使用 | +| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为true时才使用 | +| is_partition_field_write_in_file | boolean | 否 | false | 只有在have_partition为true时才使用 | +| sink_columns | array | 否 | | 当此参数为空时,所有字段都是接收列 | +| is_enable_transaction | boolean | 否 | true | | +| batch_size | int | 否 | 1000000 | | +| compress_codec | string | 否 | none | | +| common-options | object | 否 | - | | +| max_rows_in_memory | int | 否 | - | 仅当file_format_type为excel时使用。 | +| sheet_name | string | 否 | Sheet${Random number} | 仅当file_format_type为excel时使用。 | +| csv_string_quote_mode | enum | 否 | MINIMAL | 仅在file_format为csv时使用。 | +| xml_root_tag | string | 否 | RECORDS | 仅在file_format为xml时使用。 | +| xml_row_tag | string | 否 | RECORD | 仅在file_format为xml时使用。 | +| xml_use_attr_format | boolean | 否 | - | 仅在file_format为xml时使用。 | +| single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。启用此参数后,batch_size将不会生效。输出文件名没有文件块后缀。 | +| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | +| parquet_avro_write_timestamp_as_int96 | boolean | 否 | false | 仅在file_format为parquet时使用。 | +| parquet_avro_write_fixed_as_int96 | array | 否 | - | 仅在file_format为parquet时使用。 | +| enable_header_write | boolean | 否 | false | 仅当file_format_type为文本、csv时使用<br/>false:不写标头,true:写标头。 | +| encoding | string | 否 | "UTF-8" | 仅当file_format_type为json、text、csv、xml时使用。 | ### path [string] @@ -186,7 +186,7 @@ oss文件系统的endpoint端点。 ### row_delimiter [string] -文件中行之间的分隔符。只需要`text`文件格式。 +文件中行之间的分隔符。只需要 `text`、`csv`、`json` 文件格式。 ### have_partition [boolean] diff --git a/docs/zh/connector-v2/sink/OssJindoFile.md b/docs/zh/connector-v2/sink/OssJindoFile.md index c103b87f08..13cea84d66 100644 --- a/docs/zh/connector-v2/sink/OssJindoFile.md +++ b/docs/zh/connector-v2/sink/OssJindoFile.md @@ -39,40 +39,40 @@ import ChangeLog from '../changelog/connector-file-oss-jindo.md'; ## 选项 -| 名称 | 类型 | 必需 | 默认值 | 描述 | -|---------------------------------------|---------|----------|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| path | string | 是 | - | | -| tmp_path | string | 否 | /tmp/seatunnel | 结果文件将首先写入临时路径,然后使用`mv`将tmp-dir提交到目标目录。需要一个OSS 目录。 | -| bucket | string | 是 | - | | -| access_key | string | 是 | - | | -| access_secret | string | 是 | - | | -| endpoint | string | 是 | - | | -| custom_filename | boolean | 否 | false | 是否需要自定义文件名 | -| file_name_expression | string | 否 | "${transactionId}" | 仅在custom_filename为true时使用 | -| filename_time_format | string | 否 | "yyyy.MM.dd" | 仅在custom_filename为true时使用 | -| file_format_type | string | 否 | "csv" | | -| field_delimiter | string | 否 | '\001' | 仅当file_format_type为text时使用 | -| row_delimiter | string | 否 | "\n" | 仅当file_format_type为text时使用 | -| have_partition | boolean | 否 | false | 是否需要处理分区。 | -| partition_by | array | 否 | - | 只有在have_partition为true时才使用 | -| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为true时才使用 | -| is_partition_field_write_in_file | boolean | 否 | false | 只有在have_partition为true时才使用 | -| sink_columns | array | 否 | | 当此参数为空时,所有字段都是Sink列 | -| is_enable_transaction | boolean | 否 | true | | -| batch_size | int | 否 | 1000000 | | -| compress_codec | string | 否 | none | | -| common-options | object | 否 | - | | -| max_rows_in_memory | int | 否 | - | 仅当file_format_type为excel时使用。 | -| sheet_name | string | 否 | Sheet${Random number} | 仅当file_format_type为excel时使用。 | -| csv_string_quote_mode | enum | 否 | MINIMAL | 仅在file_format为csv时使用。 | -| xml_root_tag | string | 否 | RECORDS | 仅在file_format为xml时使用。 | -| xml_row_tag | string | 否 | RECORD | 仅在file_format为xml时使用。 | -| xml_use_attr_format | boolean | 否 | - | 仅在file_format为xml时使用。 | +| 名称 | 类型 | 必需 | 默认值 | 描述 | +|---------------------------------------|---------|----------|--------------------------------------------|-----------------------------------------------------| +| path | string | 是 | - | | +| tmp_path | string | 否 | /tmp/seatunnel | 结果文件将首先写入临时路径,然后使用`mv`将tmp-dir提交到目标目录。需要一个OSS 目录。 | +| bucket | string | 是 | - | | +| access_key | string | 是 | - | | +| access_secret | string | 是 | - | | +| endpoint | string | 是 | - | | +| custom_filename | boolean | 否 | false | 是否需要自定义文件名 | +| file_name_expression | string | 否 | "${transactionId}" | 仅在custom_filename为true时使用 | +| filename_time_format | string | 否 | "yyyy.MM.dd" | 仅在custom_filename为true时使用 | +| file_format_type | string | 否 | "csv" | | +| field_delimiter | string | 否 | '\001' | 仅当file_format_type为text时使用 | +| row_delimiter | string | 否 | "\n" | 仅当file_format_type为 `text`、`csv`、`json` 时使用 | +| have_partition | boolean | 否 | false | 是否需要处理分区。 | +| partition_by | array | 否 | - | 只有在have_partition为true时才使用 | +| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为true时才使用 | +| is_partition_field_write_in_file | boolean | 否 | false | 只有在have_partition为true时才使用 | +| sink_columns | array | 否 | | 当此参数为空时,所有字段都是Sink列 | +| is_enable_transaction | boolean | 否 | true | | +| batch_size | int | 否 | 1000000 | | +| compress_codec | string | 否 | none | | +| common-options | object | 否 | - | | +| max_rows_in_memory | int | 否 | - | 仅当file_format_type为excel时使用。 | +| sheet_name | string | 否 | Sheet${Random number} | 仅当file_format_type为excel时使用。 | +| csv_string_quote_mode | enum | 否 | MINIMAL | 仅在file_format为csv时使用。 | +| xml_root_tag | string | 否 | RECORDS | 仅在file_format为xml时使用。 | +| xml_row_tag | string | 否 | RECORD | 仅在file_format为xml时使用。 | +| xml_use_attr_format | boolean | 否 | - | 仅在file_format为xml时使用。 | | single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。启用此参数后,batch_size将不会生效。输出文件名没有文件块后缀。 | -| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | -| parquet_avro_write_timestamp_as_int96 | boolean | 否 | false | 仅在file_format为parquet时使用。 | -| parquet_avro_write_fixed_as_int96 | array | 否 | - | 仅在file_format为parquet时使用。 | -| encoding | string | 否 | "UTF-8" | 仅当file_format_type为json、text、csv、xml时使用。 | +| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | +| parquet_avro_write_timestamp_as_int96 | boolean | 否 | false | 仅在file_format为parquet时使用。 | +| parquet_avro_write_fixed_as_int96 | array | 否 | - | 仅在file_format为parquet时使用。 | +| encoding | string | 否 | "UTF-8" | 仅当file_format_type为json、text、csv、xml时使用。 | ### path [string] @@ -134,7 +134,7 @@ oss文件系统的端点。 ### row_delimiter [string] -文件中行之间的分隔符。只需要“text”文件格式。 +文件中行之间的分隔符。只需要 `text`、`csv`、`json` 文件格式。 ### have_partition [boolean] diff --git a/docs/zh/connector-v2/sink/S3File.md b/docs/zh/connector-v2/sink/S3File.md index 721e147da5..2636475fb6 100644 --- a/docs/zh/connector-v2/sink/S3File.md +++ b/docs/zh/connector-v2/sink/S3File.md @@ -109,7 +109,7 @@ import ChangeLog from '../changelog/connector-file-s3.md'; | filename_time_format | string | 否 | "yyyy.MM.dd" | 仅当 custom_filename 为 true 时使用 | | file_format_type | string | 否 | "csv" | | | field_delimiter | string | 否 | '\001' | 仅当 file_format 为 text 时使用 | -| row_delimiter | string | 否 | "\n" | 仅当 file_format 为 text 时使用 | +| row_delimiter | string | 否 | "\n" | 仅当 file_format 为 `text`、`csv`、`json` 时使用 | | have_partition | boolean | 否 | false | 是否需要处理分区。 | | partition_by | array | 否 | - | 仅当 have_partition 为 true 时使用 | | partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 仅当 have_partition 为 true 时使用 | @@ -192,7 +192,7 @@ hadoop_s3_properties { ### row_delimiter [string] -文件中行之间的分隔符。仅在 `text` 文件格式中需要。 +文件中行之间的分隔符。仅在 `text`、`csv`、`json` 文件格式中需要。 ### have_partition [boolean] diff --git a/docs/zh/connector-v2/sink/SftpFile.md b/docs/zh/connector-v2/sink/SftpFile.md index c4b3e194a9..b53524417f 100644 --- a/docs/zh/connector-v2/sink/SftpFile.md +++ b/docs/zh/connector-v2/sink/SftpFile.md @@ -33,43 +33,43 @@ import ChangeLog from '../changelog/connector-file-sftp.md'; ## 参数 -| 名称 | 类型 | 是否必填 | 默认值 | 备注 | -|---------------------------------------|---------|----------|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| host | string | 是 | - | | -| port | int | 是 | - | | -| user | string | 是 | - | | -| password | string | 是 | - | | -| path | string | 是 | - | | -| tmp_path | string | 是 | /tmp/seatunnel | 结果文件将首先写入临时路径,然后使用`mv`将临时目录剪切到目标目录。需要一个FTP目录。 | -| custom_filename | boolean | 否 | false | 是否需要自定义文件名 | -| file_name_expression | string | 否 | "${transactionId}" | 仅在custom_filename为true时使用 | -| filename_time_format | string | 否 | "yyyy.MM.dd" | 仅在custom_filename为true时使用 | -| file_format_type | string | 否 | "csv" | | -| field_delimiter | string | 否 | '\001' | 仅当file_format_type为text时使用 | -| row_delimiter | string | 否 | "\n" | 仅当file_format_type为text时使用 | -| have_partition | boolean | 否 | false | 是否需要处理分区。 | -| partition_by | array | 否 | - | 只有在have_partition为true时才使用 | -| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为true时才使用 | -| is_partition_field_write_in_file | boolean | 否 | false | 只有在have_partition为true时才使用 | -| sink_columns | array | 否 | | 当此参数为空时,所有字段都是sink列 | -| is_enable_transaction | boolean | 否 | true | | -| batch_size | int | 否 | 1000000 | | -| compress_codec | string | 否 | none | | -| common-options | object | 否 | - | | -| max_rows_in_memory | int | 否 | - | 仅当file_format_type为excel时使用。 | -| sheet_name | string | 否 | Sheet${Random number} | 仅当file_format_type为excel时使用。 | -| csv_string_quote_mode | enum | 否 | MINIMAL | 仅当file_format_type为csv时使用。 | -| xml_root_tag | string | 否 | RECORDS | 仅当file_format_type为xml时使用 | -| xml_row_tag | string | 否 | RECORD | 仅当file_format_type为xml时使用 | -| xml_use_attr_format | boolean | 否 | - | 仅当file_format_type为xml时使用 | -| single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。启用此参数后,batch_size将不会生效。输出文件名没有文件块后缀。 | -| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | -| parquet_avro_write_timestamp_as_int96 | boolean | 否 | false | 仅当file_format_type为parquet时使用 | -| enable_header_write | boolean | 否 | false | 仅当file_format_type为text、csv时使用<br/>false:不写标头,true:写标头。 | -| parquet_avro_write_fixed_as_int96 | array | 否 | - | 仅当file_format_type为parquet时使用 | -| encoding | string | 否 | "UTF-8" | 仅当file_format_type为json、text、csv、xml时使用。 | -| schema_save_mode | string | 否 | CREATE_SCHEMA_WHEN_NOT_EXIST | 现有目录处理方式 | -| data_save_mode | string | 否 | APPEND_DATA | 现有数据处理方式 | +| 名称 | 类型 | 是否必填 | 默认值 | 备注 | +|---------------------------------------|---------|----------|--------------------------------------------|---------------------------------------------------------| +| host | string | 是 | - | | +| port | int | 是 | - | | +| user | string | 是 | - | | +| password | string | 是 | - | | +| path | string | 是 | - | | +| tmp_path | string | 是 | /tmp/seatunnel | 结果文件将首先写入临时路径,然后使用`mv`将临时目录剪切到目标目录。需要一个FTP目录。 | +| custom_filename | boolean | 否 | false | 是否需要自定义文件名 | +| file_name_expression | string | 否 | "${transactionId}" | 仅在custom_filename为true时使用 | +| filename_time_format | string | 否 | "yyyy.MM.dd" | 仅在custom_filename为true时使用 | +| file_format_type | string | 否 | "csv" | | +| field_delimiter | string | 否 | '\001' | 仅当file_format_type为text时使用 | +| row_delimiter | string | 否 | "\n" | 仅当file_format_type为 `text`、`csv`、`json` 时使用 | +| have_partition | boolean | 否 | false | 是否需要处理分区。 | +| partition_by | array | 否 | - | 只有在have_partition为true时才使用 | +| partition_dir_expression | string | 否 | "${k0}=${v0}/${k1}=${v1}/.../${kn}=${vn}/" | 只有在have_partition为true时才使用 | +| is_partition_field_write_in_file | boolean | 否 | false | 只有在have_partition为true时才使用 | +| sink_columns | array | 否 | | 当此参数为空时,所有字段都是sink列 | +| is_enable_transaction | boolean | 否 | true | | +| batch_size | int | 否 | 1000000 | | +| compress_codec | string | 否 | none | | +| common-options | object | 否 | - | | +| max_rows_in_memory | int | 否 | - | 仅当file_format_type为excel时使用。 | +| sheet_name | string | 否 | Sheet${Random number} | 仅当file_format_type为excel时使用。 | +| csv_string_quote_mode | enum | 否 | MINIMAL | 仅当file_format_type为csv时使用。 | +| xml_root_tag | string | 否 | RECORDS | 仅当file_format_type为xml时使用 | +| xml_row_tag | string | 否 | RECORD | 仅当file_format_type为xml时使用 | +| xml_use_attr_format | boolean | 否 | - | 仅当file_format_type为xml时使用 | +| single_file_mode | boolean | 否 | false | 每个并行处理只会输出一个文件。启用此参数后,batch_size将不会生效。输出文件名没有文件块后缀。 | +| create_empty_file_when_no_data | boolean | 否 | false | 当上游没有数据同步时,仍然会生成相应的数据文件。 | +| parquet_avro_write_timestamp_as_int96 | boolean | 否 | false | 仅当file_format_type为parquet时使用 | +| enable_header_write | boolean | 否 | false | 仅当file_format_type为text、csv时使用<br/>false:不写标头,true:写标头。 | +| parquet_avro_write_fixed_as_int96 | array | 否 | - | 仅当file_format_type为parquet时使用 | +| encoding | string | 否 | "UTF-8" | 仅当file_format_type为json、text、csv、xml时使用。 | +| schema_save_mode | string | 否 | CREATE_SCHEMA_WHEN_NOT_EXIST | 现有目录处理方式 | +| data_save_mode | string | 否 | APPEND_DATA | 现有数据处理方式 | ### host [string] @@ -133,7 +133,7 @@ import ChangeLog from '../changelog/connector-file-sftp.md'; ### row_delimiter [string] -文件中行之间的分隔符。仅在`text`文件格式中需要。 +文件中行之间的分隔符。仅在 `text`、`csv`、`json` 文件格式中需要。 ### have_partition [boolean] diff --git a/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseSinkConfig.java b/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseSinkConfig.java index 6fb9b3801c..47f32c0053 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseSinkConfig.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseSinkConfig.java @@ -133,7 +133,7 @@ public class BaseSinkConfig { .stringType() .defaultValue(DEFAULT_ROW_DELIMITER) .withDescription( - "The separator between rows in a file. Only needed by `text` and `csv` file format"); + "The separator between rows in a file. Only needed by `text`, `csv` and `json` file format"); public static final Option<Boolean> HAVE_PARTITION = Options.key("have_partition") diff --git a/seatunnel-connectors-v2/connector-file/connector-file-cos/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/cos/sink/CosFileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-cos/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/cos/sink/CosFileSinkFactory.java index 368228ecdb..1f0b593c8a 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-cos/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/cos/sink/CosFileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-cos/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/cos/sink/CosFileSinkFactory.java @@ -53,11 +53,13 @@ public class CosFileSinkFactory implements TableSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS, BaseSinkConfig.ENABLE_HEADER_WRITE) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, diff --git a/seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/sink/FtpFileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/sink/FtpFileSinkFactory.java index 2c5a937628..23048c568a 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/sink/FtpFileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-ftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/ftp/sink/FtpFileSinkFactory.java @@ -66,11 +66,13 @@ public class FtpFileSinkFactory extends BaseMultipleTableFileSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS, BaseSinkConfig.ENABLE_HEADER_WRITE) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, diff --git a/seatunnel-connectors-v2/connector-file/connector-file-hadoop/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/hdfs/sink/HdfsFileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-hadoop/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/hdfs/sink/HdfsFileSinkFactory.java index 684d036d41..e09d3ccdad 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-hadoop/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/hdfs/sink/HdfsFileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-hadoop/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/hdfs/sink/HdfsFileSinkFactory.java @@ -50,11 +50,13 @@ public class HdfsFileSinkFactory implements TableSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS, BaseSinkConfig.ENABLE_HEADER_WRITE) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, diff --git a/seatunnel-connectors-v2/connector-file/connector-file-jindo-oss/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/oss/jindo/sink/OssFileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-jindo-oss/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/oss/jindo/sink/OssFileSinkFactory.java index 1ffb364be0..25b8307983 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-jindo-oss/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/oss/jindo/sink/OssFileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-jindo-oss/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/oss/jindo/sink/OssFileSinkFactory.java @@ -53,11 +53,13 @@ public class OssFileSinkFactory implements TableSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS, BaseSinkConfig.ENABLE_HEADER_WRITE) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, diff --git a/seatunnel-connectors-v2/connector-file/connector-file-local/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/local/sink/LocalFileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-local/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/local/sink/LocalFileSinkFactory.java index 7da549d9e0..9e459e6cd7 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-local/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/local/sink/LocalFileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-local/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/local/sink/LocalFileSinkFactory.java @@ -60,11 +60,13 @@ public class LocalFileSinkFactory extends BaseMultipleTableFileSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS, BaseSinkConfig.ENABLE_HEADER_WRITE) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, diff --git a/seatunnel-connectors-v2/connector-file/connector-file-obs/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/obs/sink/ObsFileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-obs/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/obs/sink/ObsFileSinkFactory.java index 4d358c6b1b..20f0f288c1 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-obs/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/obs/sink/ObsFileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-obs/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/obs/sink/ObsFileSinkFactory.java @@ -52,10 +52,12 @@ public class ObsFileSinkFactory implements TableSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, diff --git a/seatunnel-connectors-v2/connector-file/connector-file-oss/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/oss/sink/OssFileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-oss/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/oss/sink/OssFileSinkFactory.java index 6ed3f6f095..b4da905e29 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-oss/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/oss/sink/OssFileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-oss/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/oss/sink/OssFileSinkFactory.java @@ -65,11 +65,13 @@ public class OssFileSinkFactory extends BaseMultipleTableFileSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS, BaseSinkConfig.ENABLE_HEADER_WRITE) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, diff --git a/seatunnel-connectors-v2/connector-file/connector-file-s3/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/s3/sink/S3FileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-s3/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/s3/sink/S3FileSinkFactory.java index 10d7628a3c..e4bbd01e4e 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-s3/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/s3/sink/S3FileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-s3/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/s3/sink/S3FileSinkFactory.java @@ -65,11 +65,13 @@ public class S3FileSinkFactory implements TableSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS, BaseSinkConfig.ENABLE_HEADER_WRITE) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, diff --git a/seatunnel-connectors-v2/connector-file/connector-file-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/sink/SftpFileSinkFactory.java b/seatunnel-connectors-v2/connector-file/connector-file-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/sink/SftpFileSinkFactory.java index 49aa4c6379..d173ad3d68 100644 --- a/seatunnel-connectors-v2/connector-file/connector-file-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/sink/SftpFileSinkFactory.java +++ b/seatunnel-connectors-v2/connector-file/connector-file-sftp/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sftp/sink/SftpFileSinkFactory.java @@ -65,11 +65,13 @@ public class SftpFileSinkFactory extends BaseMultipleTableFileSinkFactory { .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.CSV, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS, BaseSinkConfig.ENABLE_HEADER_WRITE) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE, FileFormat.JSON, + BaseSinkConfig.ROW_DELIMITER, BaseSinkConfig.TXT_COMPRESS) .conditional( BaseSinkConfig.FILE_FORMAT_TYPE,