Skip to main content
A table-valued function (TVF) that reads a file of any supported format, inferring the format and dispatching to the matching reader (READ_PARQUET, READ_CSV, READ_JSON, READ_AVRO). Use it when you do not want to name the format up front. Like the other read TVFs, it accepts a LOCATION object or direct credentials, and reads a single file or a glob of files. READ_FILES also has a shorthand: a string literal in the FROM clause is read as READ_FILES, so
is equivalent to SELECT * FROM READ_FILES('/data/events/2026-06-01.parquet'). This works for local paths and for object storage that does not need credentials (for example public Amazon S3 buckets); to pass credentials or a LOCATION, call READ_FILES(...) directly.

Format inference

The format is inferred by listing the objects the path points at and inspecting the most recent one’s name, after stripping any compression suffix (.gz, .zst, .br, …). The path itself does not need an extension: a directory or glob resolves from the files it matches, so s3://bucket/events/* containing only .json.gz objects reads as gzip-compressed JSON. Recognized extensions: If the matched objects have no usable extension, READ_FILES cannot infer the format; use the format-specific TVF (READ_PARQUET, READ_CSV, …) instead.

Syntax

When you pass AWS_ROLE_ARN, set the optional AWS_ROLE_EXTERNAL_ID to add a customer-controlled condition to your role’s trust policy.
For role-based AWS access you can additionally set an external ID. An external ID is a value you choose and control that AWS checks when Firebolt assumes your role, adding a second condition on top of your account’s unique IAM principal. Configuring one is a recommended best practice. See IAM roles.

Parameters

Parquet, JSON, and Avro read nested objects as STRUCT; ORC flattens them into separate columns. CSV and TSV are read with default dialect options (comma or tab delimiter, no header row, types inferred). To control the CSV dialect (header, quote, delimiter, null string), use READ_CSV.

Return Type

A table with the data from the file. Column names and types are inferred the same way the format-specific TVF infers them.

Examples

Read a single Parquet file, inferring the format from the extension:
The bare-path shorthand reads the same file, and works across deployment modes for public data:
Read all matching files with a glob. The format is inferred from the matched objects, so the pattern itself needs no extension:
Read a gzip-compressed CSV; both the format and the compression are inferred from the object name: