unable to query on RDBMS using apache drill

2019-02-26 05:09发布

问题:

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?

回答1:

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.



回答2:

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.