Spark Athena连接器 [英] spark Athena connector

查看:155
本文介绍了Spark Athena连接器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在spark中使用Athena,但是spark在使用JDBC驱动程序时使用prepareStatement,它给我带来了一个异常
com.amazonaws.athena.jdbc.NotImplementedException:方法Connection.prepareStatement尚未实现

I need to use Athena in spark but spark uses preparedStatement when using JDBC drivers and it gives me an exception "com.amazonaws.athena.jdbc.NotImplementedException: Method Connection.prepareStatement is not yet implemented"

能不能让我知道如何连接雅典娜

Can you please let me know how can I connect Athena in spark

推荐答案

我不知道您如何从Spark连接到Athena,但是您不需要-您可以非常轻松地从Spark查询Athena包含的数据(或更准确地说,是寄存器)。

I don't know how you'd connect to Athena from Spark, but you don't need to - you can very easily query the data that Athena contains (or, more correctly, "registers") from Spark.

雅典娜有两个部分


  1. Hive Metastore(现称为Glue数据目录)其中包含数据库和表名以及所有基础文件之间的映射

  2. Presto查询引擎,可将SQL转换为针对这些文件的数据操作

启动EMR集群(v5.8.0及更高版本)时,可以指示其连接到Glue数据目录。这是创建集群对话框中的复选框。选中此选项后,您的Spark SqlContext 将连接到Glue数据目录,您将能够看到Athena中的表。

When you start an EMR cluster (v5.8.0 and later) you can instruct it to connect to your Glue Data Catalog. This is a checkbox in the 'create cluster' dialog. When you check this option your Spark SqlContext will connect to the Glue Data Catalog, and you'll be able to see the tables in Athena.

然后可以正常查询这些表。

You can then query these tables as normal.

请参见 https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-spark-glue.html 了解更多

这篇关于Spark Athena连接器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆