Re: Starting with Apache Calcite as SQLPlanner

2017-09-26 Thread Enrico Olivelli
Thank you all very much! You gave me good ideas and pointers! I hope I will find my way for indexes... I will be back with news Enrico On mar 26 set 2017, 19:50 Julian Hyde wrote: > On the subject of indexes. There are a couple of threads on this list > about how to

Re: Starting with Apache Calcite as SQLPlanner

2017-09-26 Thread Julian Hyde
On the subject of indexes. There are a couple of threads on this list about how to represent indexes as materialized views (sorted projections) so that the planner can consider using them. Phoenix has used this technique. I think you could find them if you search. Julian > On Sep 26, 2017,

Re: Starting with Apache Calcite as SQLPlanner

2017-09-26 Thread Michael Mior
Yes, using Planner does abstract away some of the details for you which could be a good way to get started. The code snippet you posted would be a good start. core/src/test/java/org/apache/calcite/tools/PlannerTest.java has a lot of examples of the use of the planner interface. If you're looking

Re: Starting with Apache Calcite as SQLPlanner

2017-09-26 Thread Gian Merlino
Druid uses Calcite for SQL parsing and planning. The code is all in https://github.com/druid-io/druid/tree/master/sql/src/main/java/io/druid/sql if you want to take a look. The user-facing docs are at http://druid.io/docs/latest/querying/sql.html if you want to see how users interact with it. The

Re: Starting with Apache Calcite as SQLPlanner

2017-09-26 Thread Enrico Olivelli
Thank you for your Quick response Michael. I will try to follow your suggestions I will be back soon with my results There is another API Frameworks.getPlanner() which does something similar Planner planner = Frameworks.getPlanner(config); SqlNode parsed = planner.parse("SELECT * FROM MYTABLE");

Re: Starting with Apache Calcite as SQLPlanner

2017-09-26 Thread Michael Mior
That's definitely possible and is definitely the kind of use case Calcite is designed for. In terms of Calcite APIs, the approach would be something like the following: Use SqlParser to get a SqlNode representing the query Implement CatalogReader to provide access to the schema Convert the

Starting with Apache Calcite as SQLPlanner

2017-09-26 Thread Enrico Olivelli
Hi, I would like to use Calcite as SQLPlanner in my open source project HerdDB https://github.com/diennea/herddb HerdDB is a distributed database built in Java, it is essentially a distributed key-value store but is has an SQL layer which is the entrypoint for JDBC clients. Currently we have a