READ_VORTEX returns a table with data from the specified Vortex files.
Syntax
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
- When using static credentials:
- The
URLcan be passed as either the first positional parameter or a named parameter - If you provide either
AWS_ACCESS_KEY_IDorAWS_SECRET_ACCESS_KEY, you must provide both - Providing an AWS session token is optional
- Credentials are not required for accessing public buckets
- The
- The
URLalso accepts theupload://scheme to read a file sent in the same HTTP request. See Upload and query local files. - Where local file system access is enabled, the
URLcan be a local path: absolute, relative to the engine’s working directory, or prefixed withfile://.
Return type
The result is a table with data from the Vortex files. WithoutSCHEMA, columns are read using data types inferred from the Vortex schema, and all columns are nullable.
When loading multiple files, Firebolt infers the schema from the most recently modified file. The remaining files must have compatible data types. If columns or types differ between files, pass an explicit
SCHEMA.Explicit schema
WithSCHEMA, every file is read into the declared columns:
- Columns are matched to file columns by name, case-sensitively. File columns not in the schema are not read.
- A declared column that is absent from a file reads as
NULLfor that file’s rows. If the column is declaredNOT NULL, it reads as its type’s zero value (0,'',false) instead. - A declared struct field that is absent from the file’s struct reads the same way.
- A column whose declared type differs from the file’s type is cast to the declared type. A value that cannot be cast fails the query.
Best practice
Firebolt recommends using aLOCATION object to store credentials for authentication.
When using READ_VORTEX(), the URL parameter in the location should contain only Vortex files (see location table-valued functions).
Examples
Example The following code example reads the first 5 rows from Vortex files using aLOCATION object to store credentials for authentication:
2025-*/*.vortex within the location’s base path.
Example: Reading files with differing columns into one schema
old.vortex has columns id and name; new.vortex has id, name, and score. The declared schema covers both, and score is NULL for rows from old.vortex:
Using URL
- The
URLcan be passed as either the first positional parameter or a named parameter. For example, the following two queries both read the same file:
- The
URLcan represent a single file or a glob pattern. If a glob pattern is used, all files matching the pattern are read. The special column$source_file_nameidentifies the source file of each row in the result set:
*) can only be used at the end of the path. You can use it with any text before or after, such as *.vortex, date=2025*.vortex, or data_*.vortex.
The pattern recursively matches files in all subdirectories.