{"id":"0b3eb580-1ba4-4970-b57a-a9e42f75d378","task":"Query federated data across an Iceberg catalog and a PostgreSQL connector in Trino with a cross-catalog join","domain":"trino.io","steps":["Ensure both connectors are configured: the Iceberg connector (e.g., catalog name iceberg) with iceberg.catalog.type set to glue, hive, or rest, and the PostgreSQL connector (e.g., catalog name pg) with the appropriate JDBC connection properties","Write a cross-catalog join query using fully qualified table names: SELECT i.customer_id, i.order_total, p.customer_segment FROM iceberg.sales.orders i JOIN pg.crm.customers p ON i.customer_id = p.id WHERE i.order_date >= DATE '2024-01-01'","Push down predicates explicitly in each branch of the query to limit data movement: Trino will push predicates to each connector independently but may not always push complex expressions; verify with EXPLAIN that partition/index pruning is applied on both sides","Tune the join strategy: for large Iceberg tables joined to small PostgreSQL dimension tables, ensure the PostgreSQL side is the build side of the hash join by placing it in the right-hand position or using the /*+ broadcast */ hint if supported","Monitor cross-connector joins in the Trino Web UI; network transfer bytes between stages indicates data shuffled across the cluster — large values suggest the predicate pushdown is not limiting the PostgreSQL side sufficiently"],"gotchas":["Trino fetches data from each connector independently and performs the join in Trino workers; there is no pushdown of the join itself to either system — ensure both sides are filtered aggressively before the join to avoid pulling large datasets into Trino memory","PostgreSQL connector may not push down all Trino function calls (e.g., Trino-specific date functions); wrap predicates in forms the JDBC connector can translate to SQL, or apply them as post-join filters","Cross-catalog transactions are not supported in Trino; each connector operates independently, so a federated INSERT INTO SELECT across catalogs is not atomic — a failure mid-query may result in partial writes"],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:15.651Z"},"url":"https://mcp.waymark.network/r/0b3eb580-1ba4-4970-b57a-a9e42f75d378"}