Skip to main content
When using the S3 connector, RisingWave does not guarantee the order of file reading, nor does it ensure resuming from the same file after a recovery. However, we guarantee that every file will eventually be fully read.

Syntax

For CSV data, specify the delimiter in the delimiter option in ENCODE properties.
schema_definition:

Parameters

In RisingWave Cloud, the default AWS credential provider chain is disabled. Provide s3.credentials.access and s3.credentials.secret (or use a supported assume-role setup). These credentials cannot be omitted. The enable_config_load option is supported only in self-hosted deployments.
Empty cells in CSV files will be parsed to NULL.

Additional columns

Working with S3 sources

Learn how to work with S3 sources through practical examples and scenarios. To avoid conflicts, double-quote all field names (e.g., "field_name") when working with case-sensitive sources. For more conventions on naming and identifier handling, see Identifiers.

Basic examples

Here are examples of connecting RisingWave to an S3 source to read data from individual streams.

Object filtering in S3 buckets

RisingWave has a prefix argument designed for filtering objects in the S3 bucket. It relies on Apache Opendal whose prefix filter implementation is expected to be released soon.

Handle new files in the bucket

RisingWave periodically scans for new files matching the pattern (default interval: 60 seconds). To customize the discovery interval, set refresh.interval.sec (in seconds). RisingWave automatically ingests new files added to the bucket. However, it does not detect updates to a file if a file is deleted and a new file with the same name is added simultaneously. Additionally, RisingWave will ignore file deletions.

Read data from the source

You need to create a materialized view from the source or create a table with the S3 connector to read the data. Here are some examples:
Column names and types are not inferred automatically from the source. You must explicitly define them when creating the table or materialized view.

Read Parquet files from S3

You can use the table function file_scan() to read Parquet files from S3, either a single file or a directory of Parquet files.
Function signature
When reading a directory of Parquet files, the schema will be based on the first Parquet file listed. Please ensure that all Parquet files in the directory have the same schema.
For example, assume you have a Parquet file named sales_data.parquet that stores a company’s sales data, containing the following fields:
  • product_id: Product ID
  • sales_date: Sales date
  • quantity: Sales quantity
  • revenue: Sales revenue
You can use the following SQL statement to read this Parquet file: Read a single Parquet file
If you have several such Parquet files, you can also read by their file directory: Read a directory of Parquet files

Handle unexpected file types or poorly formatted files

RisingWave will attempt to interpret and parse files, regardless of their type, as CSV or ndjson, based on the specified rules. Warnings will be reported for parts of the file that cannot be parsed, but the source part will not fail. Poorly formatted parts of a file will be discarded.