A common approach to using the adapters is via a JDBC connection
string which specifies the required parameters for the adapter
(example below in Scala since I had the code handy).

  val connString =
"jdbc:calcite:schemaFactory=org.apache.calcite.adapter.cassandra.CassandraSchemaFactory;
schema.host=" +
                   host + "; schema.port=" + port + ";
schema.keyspace=" + keyspaceName
  val connectionProps = new Properties()
  connectionProps.put("user", "admin")
  connectionProps.put("password", "admin")
  val conn = DriverManager.getConnection(connString, connectionProps)

However, I'm guessing this isn't quite what you want. Alternatively,
you can use the adapter's schema factory (e.g. CassandraSchemaFactory)
to construct a schema instance (CassandraSchema). From there you could
use Calcite's RelBuilder (or parse from SQL) to build a query. The
rules for pushdown should automatically be registered in Calcite's
planner if you're using Calcite. I'm not too familiar with Drill's
query planning, but I'm sure something similar would work.

--
Michael Mior
[email protected]

Le ven. 17 janv. 2020 à 13:29, Charles Givre <[email protected]> a écrit :
>
> 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