【发布时间】:2018-03-23 10:24:08
【问题描述】:
我需要将 AWS Athena 服务与现有的 Hive Metastore(不是 AWS Glue)集成。
请告诉我如何将 Athena 连接到 Hive Metastore。
【问题讨论】:
标签: amazon-web-services amazon-athena hive-metastore
我需要将 AWS Athena 服务与现有的 Hive Metastore(不是 AWS Glue)集成。
请告诉我如何将 Athena 连接到 Hive Metastore。
【问题讨论】:
标签: amazon-web-services amazon-athena hive-metastore
Athena 仅适用于其自己的元存储或相关的 AWS Glue 元存储。它不适用于外部元存储。
但是,您可以在同一个底层 S3 存储上设置多个表或数据库。因此,如果您使用外部元存储将数据写入 S3,则可以在 Athena 的元存储中设置适当的数据库和表定义后使用 Athena 查询这些文件。
【讨论】:
另一种方法是使用命令将配置单元元数据导出到文件
command="hive -f "+schema+"_tables.hql -S >> "+schema+".output"
其中 schema= 被导出并使用 python 中的 groovy 将表定义导入 Athena。
可以在链接中找到设置 groovy 的说明
【讨论】:
Amazon Athena 刚刚发布了一项新功能(现在为预览版),可让您将 Athena 连接到您的 Apache Hive Metastore。你可以看到公告here。 Athena documentation 中提供了添加 Hive Metastore 连接器的详细步骤。
【讨论】: