Skip to main content
Version: Next

BosFile

BOS file source connector

Support Those Engines

Spark
Flink
SeaTunnel Zeta

Key features

Description

Read data from Baidu Cloud BOS (Baidu Object Storage) via the BOS HDFS SDK.

tip

If you use Spark/Flink, in order to use this connector you must ensure your Spark/Flink cluster already integrated Hadoop. The tested Hadoop version is 2.x.

If you use SeaTunnel Engine, Hadoop jars are bundled under ${SEATUNNEL_HOME}/lib.

To use this connector you need to put bos-hdfs-sdk (>= 1.0.4-community) into ${SEATUNNEL_HOME}/lib. Download: bos-hdfs-sdk-1.0.4-community.jar.zip. See connector-file-bos/lib/README.md for details.

Options

nametyperequireddefault value
pathstringyes-
file_format_typestringyes-
bucketstringyes-
access_keystringyes-
secret_keystringyes-
endpointstringyes-
read_columnslistno-
delimiter/field_delimiterstringno\001 for text and , for csv
row_delimiterstringno\n
parse_partition_from_pathbooleannotrue
skip_header_row_numberlongno0
date_formatstringnoyyyy-MM-dd
datetime_formatstringnoyyyy-MM-dd HH:mm:ss
time_formatstringnoHH:mm:ss
schemaconfigno-
sheet_namestringno-
excel_enginestringnoPOI
poi_excel_max_file_sizelongno52428800
xml_row_tagstringno-
xml_use_attr_formatbooleanno-
csv_use_header_linebooleannofalse
file_filter_patternstringno-
filename_extensionstringno-
compress_codecstringnonone
archive_compress_codecstringnonone
encodingstringnoUTF-8
binary_chunk_sizeintno1024
binary_complete_file_modebooleannofalse
common-optionsno-
file_filter_modified_startstringno-
file_filter_modified_endstringno-
quote_charstringno"
escape_charstringno-
recursive_file_scanbooleannotrue
sort_files_by_modification_timebooleannofalse

path [string]

The source file path under the bucket.

bucket [string]

The BOS bucket address, for example bos://my-bucket.

access_key [string]

The Baidu Cloud BOS access key.

secret_key [string]

The Baidu Cloud BOS secret key.

endpoint [string]

The BOS endpoint, for example http://bj.bcebos.com.

file_format_type [string]

Supported file types: text, csv, parquet, orc, json, excel, xml, binary, markdown, pdf.

common options

Source plugin common parameters, please refer to Source Common Options for details.

Example

source {
BosFile {
bucket = "bos://source-bucket"
path = "/warehouse/table/"
file_format_type = "orc"
access_key = "your-access-key"
secret_key = "your-secret-key"
endpoint = "http://bj.bcebos.com"
}
}

Transfer Binary File

env {
parallelism = 1
job.mode = "BATCH"
}

source {
BosFile {
bucket = "bos://source-bucket"
path = "/read/binary/"
file_format_type = "binary"
access_key = "your-access-key"
secret_key = "your-secret-key"
endpoint = "http://bj.bcebos.com"
binary_chunk_size = 2048
}
}

sink {
BosFile {
bucket = "bos://sink-bucket"
path = "/write/binary/"
file_format_type = "binary"
access_key = "your-access-key"
secret_key = "your-secret-key"
endpoint = "http://bj.bcebos.com"
}
}

Filter File

source {
BosFile {
bucket = "bos://source-bucket"
path = "/read/data/"
file_format_type = "text"
access_key = "your-access-key"
secret_key = "your-secret-key"
endpoint = "http://bj.bcebos.com"
file_filter_pattern = "abc[DX]*.*"
schema {
fields {
id = int
name = string
}
}
}
}

Changelog

Change Log
ChangeCommitVersion
[Improve][Connector-V2] Add Hive BOSStorage and align BosFile e2e/docs with CosFilehttps://github.com/apache/seatunnel/pull/11952dev
[Feature][Connector-V2] Add BosFile source and sink for Baidu Object Storagehttps://github.com/apache/seatunnel/pull/11952dev