【问题标题】:How to connect AWS Athena to an exists Hive Metastore如何将 AWS Athena 连接到现有的 Hive Metastore
【发布时间】:2018-03-23 10:24:08
【问题描述】:

我需要将 AWS Athena 服务与现有的 Hive Metastore(不是 AWS Glue)集成。

请告诉我如何将 Athena 连接到 Hive Metastore。

【问题讨论】:

    标签: amazon-web-services amazon-athena hive-metastore


    【解决方案1】:

    Athena 仅适用于其自己的元存储或相关的 AWS Glue 元存储。它不适用于外部元存储。

    但是,您可以在同一个底层 S3 存储上设置多个表或数据库。因此,如果您使用外部元存储将数据写入 S3,则可以在 Athena 的元存储中设置适当的数据库和表定义后使用 Athena 查询这些文件。

    【讨论】:

      【解决方案2】:

      另一种方法是使用命令将配置单元元数据导出到文件

      command="hive -f "+schema+"_tables.hql -S >> "+schema+".output"

      其中 schema= 被导出并使用 python 中的 groovy 将表定义导入 Athena。

      可以在链接中找到设置 groovy 的说明

      https://github.com/aws-samples/aws-big-data-blog/tree/master/aws-blog-athena-importing-hive-metastores

      【讨论】:

      • 包含了答案的基本部分。 HTH。
      【解决方案3】:

      Amazon Athena 刚刚发布了一项新功能(现在为预览版),可让您将 Athena 连接到您的 Apache Hive Metastore。你可以看到公告here。 Athena documentation 中提供了添加 Hive Metastore 连接器的详细步骤。

      【讨论】:

        猜你喜欢
        • 2022-09-28
        • 2017-09-13
        • 1970-01-01
        • 1970-01-01
        • 2017-05-28
        • 1970-01-01
        • 1970-01-01
        • 2019-01-30
        • 2018-09-23
        相关资源
        最近更新 更多