【问题标题】:AWS EMR Presto not finding correct Hive schemas using AWS GlueAWS EMR Presto 未使用 AWS Glue 找到正确的 Hive 架构
【发布时间】:2018-03-24 21:09:14
【问题描述】:

所以我无法通过 AWS EMR 执行 Presto 查询。

我已经启动了一个运行 hive/presto 并使用 AWS Glue 作为元存储的 EMR。

当我通过 SSH 连接到主节点并运行 hive 时,我可以运行“show schemas;”它向我展示了我们在 AWS Glue 上拥有的 3 个不同的数据库。

如果我随后进入 Presto CLI 并运行“show schemas on hive”,我只会看到两个“default”和“information_schema”

对于我的生活,我无法弄清楚为什么 presto 不能看到相同的 Hive 模式。

这是 EMR 上的基本默认集群启动,主要使用默认设置。

有人能指出我应该寻找的方向吗?我检查了 hive.properties 文件,看起来不错,但我不知道为什么 presto 无法看到与 hive 相同的信息。

我确实有以下配置集

[{"classification":"hive-site", "properties":{"hive.metastore.client.factory.class":"com.amazonaws.glue.catalog.metastore.AWSGlueDataCatalogHiveClientFactory"}, "configurations":[]}]

AWS docs http://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-hive-metastore-glue.html 让它看起来应该是即插即用的,但我显然遗漏了一些东西

【问题讨论】:

    标签: amazon-web-services hive emr presto


    【解决方案1】:

    您可以从 Amazon EMR 发布版本 5.10.0 开始。只需将 hive.metastore.glue.datacatalog.enabled 属性设置为 true,如下所示:

    [
      {
        "Classification": "presto-connector-hive",
        "Properties": {
          "hive.metastore.glue.datacatalog.enabled": "true"
        }
      }
    ]
    

    您也可以手动设置 hive.metastore.glue.datacatalog.enabled=true/etc/presto/conf/catalog/hive.properties 主节点上的文件。如果 您使用此方法,请确保 在属性文件中设置hive.table-statistics-enabled=false 因为 Data Catalog 不支持 Hive 表和分区 统计数据。如果您将长时间运行的集群上的值更改为 切换 metastores,你必须重启 master 上的 Presto 服务器 节点(sudo restart presto-server)。

    来源AWS Docs

    【讨论】:

      【解决方案2】:

      看起来这已在 emr-5.10 中解决。您要添加以下配置:

      {"Classification":"presto-connector-hive","Properties":{"hive.metastore.glue.datacatalog.enabled": "true"}}
      

      来源:https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-presto-glue.html

      【讨论】:

        【解决方案3】:

        最近的 Presto 0.198 版本现在支持 AWS Glue 作为元数据源。

        添加对使用 AWS Glue 作为元存储的支持。通过设置启用它 将 hive.metastore 配置属性粘合。

        https://prestodb.io/docs/current/release/release-0.198.html

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2019-10-25
          • 2018-07-17
          • 1970-01-01
          • 2022-08-20
          • 2018-02-08
          • 1970-01-01
          • 2022-01-16
          • 1970-01-01
          相关资源
          最近更新 更多