'Can Trino choose from which database it will take a table?

I'm new to Trino (the distributed SQL query engine). I want to run the query below in Trino where table my_table exists to all the databases connected to Trino (each database contains exactly the same data-duplicates of the table).

The system consists of a coordinator and two workers on different machines and three databases each one associated with one Trino server.

SELECT * from my_table

Is there a way to run the above query without specifying the database from which Trino will take the data of my_table and let Trino decides alone for this based on query optimization methods?

When I run

SELECT * from cassandra.test_db.my_table

it returns all the data of my_table as expected, but when I don't specify the schema, it returns

Schema must be specified when session schema is not set

As I explained before, I don't want to specify the schema but let Trino decides which schema to use from the available.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source