简体   繁体   English

是否有 Spark SQL jdbc 驱动程序?

[英]Is there a Spark SQL jdbc driver?

I'm looking for a client jdbc driver that supports Spark SQL.我正在寻找支持 Spark SQL 的客户端 jdbc 驱动程序。

I have been using Jupyter so far to run SQL statements on Spark (running on HDInsight) and I'd like to be able to connect using JDBC so I can use third-party SQL clients (eg SQuirreL, SQL Explorer, etc.) instead of the notebook interface.到目前为止,我一直在使用 Jupyter 在 Spark(在 HDInsight 上运行)上运行 SQL 语句,我希望能够使用 JDBC 进行连接,以便我可以使用第三方 SQL 客户端(例如 SQuirreL、SQL Explorer 等)代替笔记本界面。

I found an ODBC driver from Microsoft but this doesn't help me with java-based SQL clients.我从 Microsoft 找到了一个 ODBC 驱动程序,但这对我使用基于 Java 的 SQL 客户端没有帮助。 I also tried downloading the Hive jdbc driver from my cluster, but the Hive JDBC driver does not appear to support more advance SQL features that Spark does.我还尝试从我的集群下载 Hive jdbc 驱动程序,但 Hive JDBC 驱动程序似乎不支持 Spark 支持的更高级的 SQL 功能。 For example, the Hive driver complains about not supporting join statements that are not equajoins, where I know that this is a supported feature of Spark because I've executed the same SQL in Jupyter successfully.例如,Hive 驱动程序抱怨不支持非等式连接的连接语句,我知道这是 Spark 支持的功能,因为我已经在 J​​upyter 中成功执行了相同的 SQL。

the Hive JDBC driver does not appear to support more advance SQL features that Spark does Hive JDBC 驱动程序似乎不支持 Spark 支持的更高级的 SQL 功能

Regardless of the support that it provides, the Spark Thrift Server is fully compatible with Hive/Beeline's JDBC connection .无论它提供何种支持,Spark Thrift Server 都与 Hive/Beeline 的 JDBC 连接完全兼容

Therefore, that is the JAR you need to use.因此,这就是您需要使用的 JAR。 I have verified this works in DBVisualizer.我已经验证这在 DBVisualizer 中有效。

The alternative solution would be to run Spark code in your Java clients (non-third party tools) directly and skip the need for the JDBC connection.另一种解决方案是直接在 Java 客户端(非第三方工具)中运行 Spark 代码,而无需 JDBC 连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM