Skip to main content

File Connector Introduction

GeaFlow support read data from file and write data to file.

Syntax

CREATE TABLE file_table (
id BIGINT,
name VARCHAR,
age INT
) WITH (
type='file',
geaflow.dsl.file.path = '/path/to/file'
)

Options

KeyRequiredDescription
geaflow.file.persistent.config.jsonfalseThe JSON format DFS configuration will override the system environment configuration.
geaflow.dsl.file.pathtrueThe file path to read or write.
geaflow.dsl.column.separatorfalseThe column separator for split text to columns.Default value is ','.
geaflow.dsl.line.separatorfalseThe line separator for split text to columns..Default value is '\n'.
geaflow.dsl.file.name.regexfalseThe regular expression filter rule for file name reading is empty by default.
geaflow.dsl.file.formatfalseThe file format for reading and writing supports Parquet and TXT, with the default format being TXT.

Example

CREATE TABLE file_source (
id BIGINT,
name VARCHAR,
age INT
) WITH (
type='file',
geaflow.dsl.file.path = '/path/to/file'
);

CREATE TABLE file_sink (
id BIGINT,
name VARCHAR,
age INT
) WITH (
type='file',
geaflow.dsl.file.path = '/path/to/file'
);

INSERT INTO file_sink
SELECT * FROM file_source;