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.

Table 1. Data formats with a template in the Templates menu
FormatDescriptionConnectors with a template
jsonJSON recordskafka, upsert-kafka, filesystem
avroAvro records without a schema registrykafka, upsert-kafka, filesystem
csvDelimited textkafka, upsert-kafka, filesystem
rawA single column that contains the bytes or the text of the valuekafka, upsert-kafka
orcThe columnar ORC file formatfilesystem
parquetThe columnar Parquet file formatfilesystem

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.