unable to query on RDBMS using apache drill

梦想的初衷 提交于 2019-12-01 06:47:15

问题


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.



来源:https://stackoverflow.com/questions/33232644/unable-to-query-on-rdbms-using-apache-drill

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!