本文介绍了通过Java的Apache Drill连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在整个apache演练wiki中,我只能看到通过sqline客户端运行的查询。除了REST Api之外,是否有任何程式化的方法可以在Drill中运行查询?任何样本或指针?或者它与使用JDBC驱动程序运行sql查询等同吗?
解决方案
您可以使用Drill JDBC驱动程序,这里记录:
请注意,如果您正在建立你需要在本地安装Drill依赖关系:
mvn install:install-file -Dfile = /opt/apache-drill-1.0.0/jars/drill-java-exec-1.0.0-rebuffed.jar -DgroupId = org.apache.drill.exec -DartifactId = drill-java-exec -Dversion = 1.0.0 -Dpackaging = jar -DgeneratePom = true
mvn install:install-file -Dfile = / opt / apache-drill-1.0.0 / jars / drill-common-1.0.0-rebuffed.jar -DgroupId = org。 apache.drill -DartifactId = drill-common -Dversion = 1.0.0 -Dpackaging = jar -DgeneratePom = true
https://github.com/vicenteg/DrillJDBCExample
Throughout the wiki of apache drill I could only see queries running via sqline client. Is there any programmatical way to run query in Drill other than the REST Api? Any Samples or Pointers?
Or is it as equivalent as using JDBC driver to run sql queries?
解决方案
You can use the Drill JDBC driver, which is documented here: http://drill.apache.org/docs/using-the-jdbc-driver/
Note that if you're building your Java program with Maven, you'll need to install the Drill dependencies locally:
mvn install:install-file -Dfile=/opt/apache-drill-1.0.0/jars/drill-java-exec-1.0.0-rebuffed.jar -DgroupId=org.apache.drill.exec -DartifactId=drill-java-exec -Dversion=1.0.0 -Dpackaging=jar -DgeneratePom=true
mvn install:install-file -Dfile=/opt/apache-drill-1.0.0/jars/drill-common-1.0.0-rebuffed.jar -DgroupId=org.apache.drill -DartifactId=drill-common -Dversion=1.0.0 -Dpackaging=jar -DgeneratePom=true
And here's an example: https://github.com/vicenteg/DrillJDBCExample
这篇关于通过Java的Apache Drill连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!