Reputation: 41
I'm using Calcite to query from both MySql and Vertica.
When running this query:
statement.executeQuery(
"SELECT a.name, b.name " +
"FROM mysqlschema.tableA as a " +
"INNER JOIN verticaschema.tableB as b ON a.id = b.id " +
"WHERE a.id = 1 AND b.id = 1 "));
For some reason, I see that Calcite is properly accesing tableA whith the correct predicate but it's doing SELECT * FROM verticaschema.tableB
for some reason over the second table.
Is there a way of optimizing it so Calcite will run the predicate b.id=1
over tableB too?
Thanks
Upvotes: 1
Views: 871
Reputation: 774
Apache Calcite has some limitations:
Current limitations: The JDBC adapter currently only pushes down table scan operations; all other processing (filtering, joins, aggregations and so forth) occurs within Calcite. Our goal is to push down as much processing as possible to the source system, translating syntax, data types and built-in functions as we go. If a Calcite query is based on tables from a single JDBC database, in principle the whole query should go to that database. If tables are from multiple JDBC sources, or a mixture of JDBC and non-JDBC, Calcite will use the most efficient distributed query approach that it can.
You should implement it yourself.
Upvotes: 1