I know that Drill uses Calcite for query planning, and therefore I expect that 
Drill’s adapter model is probably fairly similar to Calcite’s. In fact, I have 
long wished that we used the same adapter model, so that we could share 
adapters.

Drill already uses Calcite as a runtime library, so that shouldn’t be a problem.

There is a page that documents adapters[1]. The heart of each adapter is a 
schema factory[2], which provides the metadata necessary to validate and plan a 
query. You should probably write a meta-adapter that takes a Calcite schema 
factory and converts it into a Drill adapter.

Each adapter has a test, e.g. CassandraAdapterTest. It is a good idea to 
copy-paste that test into Drill’s test suite so that you know you are 
inheriting the same functionality.

Julian

[1] https://calcite.apache.org/docs/adapter.html 
<https://calcite.apache.org/docs/adapter.html>
[2] 
https://calcite.apache.org/apidocs/org/apache/calcite/schema/SchemaFactory.html 
<https://calcite.apache.org/apidocs/org/apache/calcite/schema/SchemaFactory.html>
 

> On Jan 17, 2020, at 10:52 AM, Andrei Sereda <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> Hi Charles,
> 
> There is some documentation here
> https://calcite.apache.org/docs/adapter.html 
> <https://calcite.apache.org/docs/adapter.html> it describes how to setup and
> use an adapter.
> 
> Note that you can only use those adapters within calcite runtime and not as
> a standalone library.
> 
> Typical adapter would expose collection (for Mongo), index (for ES), region
> (for Geode) etc.  as a calcite schema / table which you can query using
> relational algebra.
> 
> How exactly do you want to extend existing adapters ?
> 
> Hope that helps.
> 
> Regards,
> Andrei.
> 
> 
> 
> 
> On Fri, Jan 17, 2020 at 1:29 PM Charles Givre <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>> Hello Calcite Devs!
>> My name is Charles Givre and I'm the PMC Chair for Apache Drill, which
>> uses Calcite for query planning among other things.  I'm working on
>> extending the number of systems that Drill can connect to and I saw that
>> Calcite has a number of adapters for various systems like Cassandra and
>> Elasticsearch.
>> 
>> Could anyone point me to some resources as to how these adapters can be
>> used (or extended) so that Drill could use them?
>> Thank you very much!
>> -- C

Reply via email to