Federated Query Table Names
- JDBC - Both
<catalog>.<database>.<schema>.<table>&<catalog>.<schema>.<table>are accepted. For a source with no schemas, such as MySQL, the name is<catalog>.<database>.<table>. - Apache Iceberg - The namespace may have any number of levels. A quoted
part containing dots is several levels, so
lake."sales.eu".ordersis the same aslake.sales.eu.orders. - Delta Lake - The name includes the Unity Catalog catalog, unless the
catalog was created with a
DATABASEoption naming it.
Querying a catalog’s tables requires
READ access on the
catalog and CONNECT access on its data source, and, for a data lake
catalog, READ access on its credential; see
GRANT Catalog Permission.Examples
To query a table in a JDBC catalog:Federated Query Example
Federated Query with Database Example
Federated Aggregation Example
Federated/Local JOIN Example
JOIN Output
Federated CREATE TABLE ... AS Example
Federated INSERT INTO ... SELECT Example
Federated View Example
Performance
- All of the tables a statement reads from a catalog are described by its external source in one call per catalog, while the statement is planned.
- Each table is loaded once per statement, even when it is referenced more than once, as in a self-join.
- Only the columns a statement reads are loaded, and filters are passed to the external source; for a data lake table, filters are used to skip data files.
- A part of a statement that reads only the tables of one JDBC data source is sent to that source as a single query, so its joins, aggregates, and limits are performed by the source.
Limitations
-
Tables in a catalog are read-only;
INSERT,UPDATE,DELETE&MERGEstatements that write to them are rejected:Federated UPDATE ExampleUPDATE Output -
A materialized view over a table
in a catalog is not supported; use
CREATE TABLE ... ASto copy the table into the database instead:Federated Materialized View ExampleMaterialized View Output - The query plans of statements that read tables in a catalog are not cached, and Apache Iceberg time travel is not supported.
-
The
CURRENT_CATALOGfunction always returnsKINETICA.