Filesystem connector
The Filesystem connector reads files from a directory and writes files to a directory. The files are partitioned in directories, and each file has the format that you set in the table.
Object storage on Anywhere Cloud
On Anywhere Cloud, use the connector with object storage. The engine
includes the filesystem plugins for Amazon S3, Google Cloud Storage, and Azure Blob
Storage, and you use a path with the scheme of the storage, such as
s3://.
A path with the file:// scheme refers to the filesystem of a pod of the
engine. The files are lost when the pod restarts. Use such a path only to try out a
table. A path with the hdfs:// scheme works only if the job can reach a Cloudera Base on premises cluster. For more information, see
Using Cloudera Base Connector in the Anywhere Cloud documentation.
The following example writes JSON files to a bucket:
CREATE TABLE orders_archive (
order_id STRING,
price DECIMAL(10, 2),
order_time TIMESTAMP(3)
) WITH (
'connector' = 'filesystem',
'path' = 's3://<bucket>/orders/',
'format' = 'json'
);
Mandatory properties
| Property | Description |
|---|---|
connector | filesystem |
path | The path of the root directory of the table. There is no default value. |
format | The format of the files. The templates exist for Avro, CSV, JSON, ORC, and Parquet. |
Optional properties
| Property | Description |
|---|---|
sink.rolling-policy.file-size | The size at which a sink closes a file. The default is 128 MB. |
sink.rolling-policy.rollover-interval | The time after which a sink closes a file. The default is 30 minutes. |
sink.rolling-policy.check-interval | How often the sink checks the rollover time. The default is 1 minute. |
auto-compaction | Whether the sink combines small files after a checkpoint. The default is false. |
sink.partition-commit.trigger | When a partition is complete. The default is process-time. |
sink.partition-commit.delay | How long the sink waits before it commits a partition. The default is 0 seconds. |
sink.partition-commit.success-file.name | The name of the file that marks a committed partition. The default is _SUCCESS. |
sink.shuffle-by-partition.enable | Whether the sink groups rows by partition, to write fewer files. The default is false. |
For the full list of options, see FileSystem SQL connector in the Apache Flink documentation.
