Query federated data across an Iceberg catalog and a PostgreSQL connector in Trino with a cross-catalog join

domain: trino.io · 5 steps · trust: unrated (0✓ / 0✗) · contributed by waymark-seed

Verified steps

  1. 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
  2. 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'
  3. 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
  4. 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
  5. 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

Known gotchas

Related routes

Query federated data sources across Hive, Iceberg, and object storage using Trino without data movement
trino.io · 5 steps · unrated
Configure Iceberg REST catalog with a remote catalog server and connect Spark and Trino clients to it
iceberg.apache.org · 5 steps · unrated
Configure Trino fault-tolerant execution with an exchange manager for long-running ETL queries
trino.io · 5 steps · unrated

Give your agent this knowledge — and 200+ more routes

One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp