Search code examples
jsoncassandraapache-drill

Configuring Apache drill for Cassandra


I am trying to configure Cassandra with Drill. I used the same approach given on the link: https://drill.apache.org/docs/starting-the-web-ui/.

I used the following code for New Storage Plugin:

 {
  "type": "cassandra",
  "hosts": [
    "127.0.0.1"
  ],
  "port": 9042,
  "username": "<username>",
  "password": "<password>",
  "enabled": false
}

I have attached the Screenshot here.

But I'm getting the following error:

Please retry: Error (invalid JSON mapping)

How can I resolve this?


Solution

  • All the code :

    1. Git: https://github.com/yssharma/drill/tree/cassandra-storage
    2. Patch: https://gist.github.com/yssharma/2581ae8a97c559b2677f

    1. Get Drill: Lets get the Drill source

    $ git clone https://github.com/apache/drill.git
    

    2. Get Cassandra Storage patch/Download the Patch file from:

    https://reviews.apache.org/r/29816/diff/raw/
    

    3. Apply the patch on top of Drill $ cd drill $ git apply --check ~/Downloads/DRILL-92-CassandraStorage.patch $ git apply ~/Downloads/DRILL-92-CassandraStorage.patch

    4. Build Drill with Cassandra Storage & export distribution to /opt/drill

    $ mvn clean install -DskipTests
    $ mkdir /opt/drill
    $ tar xvzf distribution/target/*.tar.gz --strip=1 -C /opt/drill
    

    5. Start Sqlline. That it we have finished with the Drill build and installation – and its time we can start using Drill.

    $ cd /opt/drill
    $ bin/sqlline -u jdbc:drill:zk=local -n admin -p admin
    Drill-Sqlline
    

    Hit ‘show schemas‘ to view existing schemas.

    Drill-Sqlline-schemas

    6. Drill Web interface You should be able to see the Drill web interface on localhost:8047, or whatever your host/port is.

    Use this as your config:

     {
          "type": "cassandra",
          "config": {
            "cassandra.hosts": [
              "127.0.0.1",
              "127.0.0.2"
            ],
            "cassandra.port": 9042
          },
          "enabled": true
        }
    

    Also, if this doesnt work, know that they are working on a plugin for it now: https://github.com/apache/drill/pull/1960