简体   繁体   中英

Accessing crateDB via Apache Drill

I need to access data in my crate database via Apache Drill. Far as i have read, crate has a PostgreSQL interface , but that is not compatible with the PostgreSQL interface exposed by drill. There isn't much information on this available on the internet. One way to go about it is implementing a custom storage plugin. But did not find helpful information about that either. i went through this , but not to much avail. Any insights, references, links, information is appreciated.

Another way i tried connecting to crate via apache drill was using the storage configuration:

{
type: "jdbc",
enabled: true,
driver: "io.crate.client.jdbc.CrateDriver",
url:"jdbc:crate://localhost:5432/"
}

and jars: crate-jdbc-1.9.1.jar and crate-jdbc-standalone-2.2.0.jar

This did not work for me either.

I could successfully connect to crate via Apache Drill using the following configuration:

1. Storage configuration to connect to crate via Apache Drill (embedded mode):

{
"type": "jdbc",
"driver": "io.crate.client.jdbc.CrateDriver",
"url": "jdbc:crate://localhost:5432/",
"username": "crate",
"password": null,
"enabled": true
}

  1. Use the jar crate-jdbc-standalone-2.2.0.
    Add it in drill-installation-dir/jars/3rdparty
    In drill-installation-dir/conf/drill-override.conf add line

    drill.exec.sys.store.provider.local.path = "crate-jdbc-standalone-2.2.0.jar"

Query Sample:

select * from cratestorageplugin.doc.test

where:
cratestorageplugin: storage plugin created for crate
doc: schema name
test: table name

Kudos and big big thanks to crate team for all their help and prompt support!

Note: This method can prove useful, if your tables do not have dynamic data type. We can only query tables with simple data types with this connection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM