3

With apache drill 1.2, we can query over RDBMS data. Check more here: https://drill.apache.org/blog/2015/10/16/drill-1.2-released/

so, I tried to add a plugin for MySQL. I am doing it using the web client. I created a plugin with name mysql and added following configurations:

{
  "type": "jdbc",
  "driver": "com.mysql.jdbc.Driver",
  "uri": "jdbc:mysql://<IP>:3306/classicmodels",
  "username": "root",
  "password": "root",
  "enabled": true
}

Also, I added mysql.jar in /apache-drill-1.2.0/jars/3rdparty

It is showing error:

(Invalid JSON mapping)

Any pointer on this. Is there any documentation for that?

Dev
  • 13,492
  • 19
  • 81
  • 174

2 Answers2

3

The correct way to add storage plugin for MySQL:

{
  "type": "jdbc",
  "driver": "com.mysql.jdbc.Driver",
  "url": "jdbc:mysql://<IP>",
  "username": "root",
  "password": "root",
  "enabled": true
}

noticed url instead of uri.

After adding plugin, query can be done using:

select * from mysql.classicmodels.`customers`;

where classicmodels is Database name & customers table name.

Dev
  • 13,492
  • 19
  • 81
  • 174
  • 2
    Don't use the products table of the classicmodels database, and maybe other tables that use the TEXT type, due unresolved issues: http://drill.apache.org/docs/apache-drill-1-2-0-release-notes/#important-unresolved-issues. To test the Drill connection, you can use the performance_schema and a query, e.g., select * from myplugin.performance_schema.accounts; – catpaws Oct 21 '15 at 12:36
1

Apologies for bumping out. I've got a similar issue while creating Storage/Configurations. When including the configurations under plugin creation, it says a Unable to create/update storage. Did you encounter this issue while creating a storage plugin? I followed the docs from drill

EDIT:

Drill does test connection on the fly when creating the plugin. The machine wasn't up at the time of creating the plugin. When the machine was back, it worked.

dmachop
  • 824
  • 1
  • 21
  • 39