Data formats
A data format defines how a connector maps the bytes of a record or a file to the columns of a table. You set the format in the format option of a table, or in the key.format and value.format options.
| Format | Description | Connectors with a template |
|---|---|---|
json | JSON records | kafka, upsert-kafka, filesystem |
avro | Avro records without a schema registry | kafka, upsert-kafka, filesystem |
csv | Delimited text | kafka, upsert-kafka, filesystem |
raw | A single column that contains the bytes or the text of the value | kafka, upsert-kafka |
orc | The columnar ORC file format | filesystem |
parquet | The columnar Parquet file format | filesystem |
Other formats
The engine also includes other Flink formats. For example, the
debezium-json format reads the change events that Debezium writes to a
Kafka topic, so that the table is a changelog table:
CREATE TABLE customers_changes (
id INT,
name STRING,
country STRING
) WITH (
'connector' = 'kafka',
'properties.bootstrap.servers' = '<broker>:9093',
'topic' = 'shop.public.customers',
'scan.startup.mode' = 'earliest-offset',
'format' = 'debezium-json'
);
To see the properties of a format in the Streaming SQL Console, open External Resources in the Explorer, expand Data Formats, and click the name of a format. For a format that is not in this release, see Adding a new data format.
For the options of each format, see Formats in the Apache Flink documentation.
