Bucket Tables
Bucket Tables expose files from a connected bucket as queryable external tables. Use them when Parquet, CSV, or JSON files already exist in object storage and you want to query them without copying the data into an Altertable catalog.
Each table maps a logical table name to a path in the bucket. Queries read the files at that path through the lakehouse SQL engine.
When to use Bucket Tables
Use Bucket Tables for:
- Data exports that already land in object storage.
- Shared Parquet datasets owned by another pipeline.
- CSV or JSON files that need to be joined with other lakehouse sources.
- Hive-style partitioned paths where partition keys should be available as columns.
- Logs laid out in date folders, such as AWS WAF or CloudTrail logs, using placeholders.
If the files are an Iceberg dataset, use Iceberg Tables instead so Altertable can read Iceberg metadata.
Connect Bucket Tables
- Open Catalogs in the Altertable app.
- Click New catalog.
- Select Bucket Tables.
- Choose the connected bucket that contains the files.
- Add one or more table mappings with a table name, path, and file format.
- Save the catalog, then query the mapped tables with SQL.
Table mappings
Use stable, descriptive table names and point each one at the files Altertable should read:
Field | Description | Example |
|---|---|---|
Table name | The table name exposed in the external catalog | events |
Path | The files to read inside the connected bucket. See paths | exports/events/**/*.parquet |
Format | How the files are read: Parquet, CSV, or JSON. CSV and JSON files can be compressed, such as .csv.gz | Parquet |
After the catalog is connected, query tables with fully qualified names such as bucket_exports.main.events.
Paths
A path ends with a file name or a file pattern. * matches any characters within a folder or file name, ? matches exactly one character, and ** matches any number of folders:
Path | Reads |
|---|---|
exports/2026.csv | A single file |
exports/*.csv* | Every CSV file directly in exports/, compressed or not |
events/**/*.parquet | Every Parquet file in events/ and its subfolders |
Files in Hive-style key=value folders, such as events/dt=2026-01-01/part-0.parquet, expose each key as a column, and filtering on it only reads the matching folders.
Placeholders
Not all files are laid out in Hive-style key=value folders. AWS service logs, for example, use date folders: WAF writes to AWSLogs/<account>/WAFLogs/<region>/<web-acl>/YYYY/MM/DD/HH/mm/<file>.log.gz. To read such a layout, add placeholders to the path. Each placeholder becomes a column:
AWSLogs/123456789012/WAFLogs/cloudfront/my-web-acl/{log_time:%Y/%m/%d/%H/%M}/*.log.gz
Syntax | Matches | Column |
|---|---|---|
{name} | Part or all of one folder or file name, such as region={region} | name, as text |
{name:format} | A date or time spread over one or more folders. The format uses %Y (year), %m (month), %d (day), %H (hour), %M (minute) and %S (second), such as {day:%Y/%m/%d} or dt={day:%Y-%m-%d} | name, as a UTC timestamp |
WAF log files are JSON lines, so set the table's format to JSON.
Filtering on a placeholder column skips the files that can't match, so queries over a time range only read that range:
SELECT action, count(*)FROM waf_logs.main.requestsWHERE log_time >= now() - INTERVAL 1 DAYGROUP BY action;
Limits:
- Every query lists the files under the path's fixed folders, before the first placeholder or wildcard. Keep that prefix as specific as possible in large buckets.
- A placeholder can't share a name with a field inside the files. AWS WAF records already have a
timestampfield, for example, so name the placeholderlog_time. - A path with placeholders doesn't detect Hive-style folders. Write them as placeholders instead, such as
region={region}. - Files that match the path's wildcards but not its placeholders, such as a stray
2026/04/tmp/folder, are read withNULLplaceholder columns.