0

I am working on the development of a Connector interface with Elasticsearch (translate SQL to API DSL query syntax) .

I am starting with Apache Calcite CSV Adapter as a first step to test Calcite capabilities. I followed the tutorial https://calcite.apache.org/docs/tutorial.html 

My question is how to use the JDBC connector (and which configuration) in a SQL client like Dbeaver or Squirrel... ?

Thanks

Edit: This my configuration but it's not working enter image description here

enter image description here

Error: enter image description here

O. Sam
  • 178
  • 1
  • 5
  • 17
  • Have you looked at the existing [Elasticsearch adapter](https://calcite.apache.org/docs/elasticsearch_adapter.html)? – Michael Mior Feb 22 '22 at 20:26

1 Answers1

1

The DBeaver documentation describes how to add a new database driver. You can specify whatever parameters you need as well as provide a Calcite JAR file so the necessary code is available.

The class name should be org.apache.calcite.jdbc.Driver. The URL Template will be something like jdbc:calcite:model=path/to/model.json where you specify a path to a model.json file which contains the necessary model to create the connection.

Michael Mior
  • 28,107
  • 9
  • 89
  • 113
  • Thanks for your reply. I tried that but it s not working on Dbeaver. Do I need to use a jar? – O. Sam Feb 22 '22 at 21:59
  • @O.Sam Yes. As I mentioned in my answer, you will need to provide the Calcite JAR file. In general, if something is *not working*, providing some details of the problem you are experiencing is necessary to provide additional assistance. – Michael Mior Feb 23 '22 at 13:42
  • I edited my question with the current configuration and the occuring error. – O. Sam Feb 23 '22 at 16:33
  • @O.Sam As the error message states, you are missing required JAR files. You need to add the `calcite-core` jar and whatever other related JARs for any adapters you are using. The `sqllineClasspath` JAR does not contain any relevant code. – Michael Mior Feb 23 '22 at 16:38
  • I added `calcite-core` jar which generate two classes `org.apache.calcite.avatica.remote.Driver` and `org.apache.commons.dbcp2.PoolingDriver`, I had the same error with both of them – O. Sam Feb 23 '22 at 17:03
  • thanks fr your help, I want to connect my new data source in Tableau through JDBC connection. I created an other question here https://stackoverflow.com/questions/71499567/connect-calcite-jdbc-connector-in-tableau-software – O. Sam Mar 16 '22 at 15:13