OPEN DELTA TABLE

Opens an existing Delta table from a storage location and makes it queryable under a session-scoped alias. Delta-only by design; non-Delta formats use CREATE EXTERNAL TABLE.

Category: data-loadingDeltaForge extension

Syntax

OPEN DELTA TABLE '<path>' AS <alias>

Description

## Overview OPEN DELTA TABLE registers an existing Delta table at a storage location into the current query session under a user-specified alias. This provides a lightweight, session-scoped way to make a Delta table queryable without writing it to the persistent catalog. Once opened, the table can be referenced by its alias in any SQL statement (SELECT, JOIN, subqueries, CTAS, etc.) for the remainder of the session. ## Delta-only by design OPEN DELTA TABLE is a session-scoped handle for Delta tables specifically. Non-Delta formats (Parquet, CSV, JSON, Avro, ORC, etc.) are loaded through CREATE EXTERNAL TABLE, which owns the OPTIONS surface needed for those formats (header, delimiter, partition discovery, schema overrides). Keeping OPEN narrowed to Delta avoids duplicating that surface area on a session-scoped command. ## How the path is resolved Absolute filesystem paths and cloud URLs (`s3://`, `abfss://`, `gs://`, `file:///`, `~/...`) are honored verbatim. A relative LOCATION is resolved against the alias's zone storage_root, so `OPEN DELTA TABLE 'foo' AS x` reopens what a prior `CREATE DELTA TABLE LOCATION 'foo'` wrote in the same zone. Cross-zone or cross-cloud redirection is not allowed. ## Session scope OPEN DELTA TABLE registrations are session-scoped. They persist for the lifetime of the current execution context and are not stored in the persistent catalog. If you need the table to be available across sessions and compute nodes, use REGISTER DELTA TABLE (catalog-persisted) or CREATE EXTERNAL TABLE. ## Alias validation The alias must not contain forward slashes (`/`) or backslashes (`\\`); a path-shaped alias is rejected. Three-part dotted names are accepted by the registry layer when the alias is a fully-qualified `zone.schema.table`; in that case the underlying DataFusion catalog and schema are auto-created if missing. ## OPEN DELTA TABLE vs REGISTER DELTA TABLE | Aspect | OPEN DELTA TABLE | REGISTER DELTA TABLE | |-----------------|-----------------------------------|-------------------------------------------| | Persistence | Session-scoped | Catalog-persisted across sessions | | Format | Delta only | Delta only (use CREATE EXTERNAL TABLE for other formats) | | Name | Any alias | Three-part `zone.schema.table` only | | LOCATION | Absolute, cloud URL, or relative | Relative path under the zone's storage_root | | Catalog entry | No | Yes | | Admin grant | No | Yes, to the caller | | Epoch bump | No | Yes (token cache, providers, ODBC refresh) | ## Cloud storage For cloud paths, the engine uses the configured object store for the session. Credentials are resolved from the session's permission token or environment configuration. The object store must be configured before OPEN DELTA TABLE is called; otherwise the Delta log cannot be read. ## Lazy loading Delta tables are opened with lazy loading enabled. The initial OPEN DELTA TABLE call reads only the transaction log metadata (typically a few KB). Actual data files are read on demand when queries execute. This makes OPEN DELTA TABLE near-instantaneous even for very large tables.

Parameters

NameTypeDescription
locationSpecifies the storage path or URI of the existing Delta table to open. Supports local filesystem paths (/data/tables/events, file:///data/tables/events), tilde-expanded paths (~/tables/events), Amazon S3 (s3://bucket/tables/events), Azure Data Lake Storage Gen2 (abfss://container@account.dfs.core.windows.net/tables/events), and Google Cloud Storage (gs://bucket/tables/events). The path must point to a directory containing a _delta_log/ subdirectory.
aliasSpecifies the name used to reference the table in SQL queries for the duration of the session. Must not contain forward slashes or backslashes. The alias is registered in the DataFusion session context and persists until the session ends or the table is explicitly deregistered.

Examples

-- Open a Delta table from a local path
OPEN DELTA TABLE '/data/lakehouse/events' AS events;
-- Open a Delta table from S3
OPEN DELTA TABLE 's3://data-lake/bronze/orders' AS orders;
-- Open a Delta table from Azure Data Lake Storage Gen2
OPEN DELTA TABLE 'abfss://gold@storageacct.dfs.core.windows.net/marts/customers' AS customers;
-- Open a Delta table from GCS
OPEN DELTA TABLE 'gs://analytics-bucket/gold/summary' AS summary;
-- Open a Delta table using tilde expansion
OPEN DELTA TABLE '~/datasets/sensor_data' AS sensors;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →