Skip to content

trino_iceberg

etl_craft.dialects.warehouse.trino_iceberg

Trino warehouse over an Iceberg catalog.

TrinoIcebergWarehouse

Bases: WarehouseDialect

Trino, Iceberg catalog: no temporary tables, no alias on UPDATE or DELETE targets.

present

present(profile: ConnectionProfile, secret: str, url: WarehouseUrl) -> Presented

Hand the credential to the Trino client through the URL query it reads.

create_table_as

create_table_as(conn: Connection, qualified_name: str, select_sql: str, params: Mapping[str, str]) -> None

Run CREATE TABLE ... AS SELECT; EXTERNAL_LOCATION is the Iceberg table's location.

Without it, the catalog places the table under its schema's location.

task_storage_problem

task_storage_problem(params: Mapping[str, str]) -> str | None

Refuse an EXTERNAL_LOCATION containing a quote; it is written into the DDL.

hash_expression

hash_expression(values: list[str], types: list[str] | None = None) -> str

Hex-encode md5(), which takes and returns varbinary on Trino.

timestamp_text

timestamp_text(value: str, kind: str) -> str

Keep microseconds without the millisecond truncation of date_format.

replacement_ddl

replacement_ddl(conn: Connection, target: str, select_sql: str, params: Mapping[str, str], *, existing: bool) -> str

Preserve the existing table's declared properties in one CTAS replacement.

full_column_types

full_column_types(conn: Connection, table: str) -> dict[str, str]

DESCRIBE retains precision and nested types exposed by the Iceberg connector.