Some of your data is in the warehouse and some is only in a database you never replicated. Peliqan has a built-in federated query engine, so one SQL query can read across both. This tutorial shows how to run one and what to watch for.
How to run a federated query
- 1Start from a normal query. A regular Peliqan query combines sources that are already in the data warehouse – Pipedrive and Odoo, for example – and runs on the warehouse itself.
- 2Add the source that is not replicated. In the demo a SQL Server is connected to Peliqan but never synced, so some tables exist only there. The federated query engine lets a single query span both systems.
- 3Enable Run Query on Trino engine. Turn the option on for that query and it executes across the systems. The example joins Pipedrive organizations from the warehouse with a Customers table in the SQL Server dbo schema.
- 4Use fully qualified names when names collide. Short table names usually resolve. If several tables share a name, open the table, choose Show details and use the fully qualified Trino table name.
- 5Check what ran. Under Trino queries you can see the queries that executed and how long they took. In the left pane a T icon marks the queries that run on Trino.
What you can do with federated queries
- Join warehouse tables with tables in an external database in one SQL query
- Leave data where it lives instead of replicating it just to be able to query it
- Reference other Trino queries to build up federated models in steps
- See running federated queries and their timings under Trino queries
About the engine
The federated engine is Trino, also known as Presto, and it is built into the Peliqan platform – nothing to install or run. One rule to remember: you cannot mix normal and Trino queries. When a Trino query references another query, that query also needs Run Query on Trino enabled.
Data spread across systems? Get started with Peliqan.