【问题标题】:Creating EXTERNAL Table on Hive for Azure Blob with credentials使用凭据在 Hive 上为 Azure Blob 创建外部表
【发布时间】:2020-01-18 08:19:47
【问题描述】:

我们在s3 和现在wasb (azure blob) 中有很多存储帐户。 当我 EXTERNAL TABLE 如下所示时,我为 s3 提供 accesssecret 密钥。

CREATE EXTERNAL TABLE IF NOT EXISTS Table_S3
(
col1                      string,
col2                      string
)
STORED AS ORC
LOCATION 's3a://*ACCESS_KEY*:*SECRET_KEY*@bucket_name/direc_name/'
tblproperties ("orc.comlress"="ZLIB");

如何在 Blob 中实现这一点?

CREATE EXTERNAL TABLE IF NOT EXISTS Table_WASB
(
col1                      string,
col2                      string
)
STORED AS ORC
LOCATION 
'wasb://container_name@STORATE_ACCOUNT_NAME.blob.core.windows.net/direc_name/'
tblproperties ("orc.comlress"="ZLIB");

我想在 create table 语法中设置我的存储访问密钥,这样我就可以访问多个存储帐户,而不是在 core-site.xml 中定义凭据

【问题讨论】:

    标签: azure amazon-s3 hive azure-blob-storage azure-hdinsight


    【解决方案1】:

    如果不存在则创建外部表 Table_WASB ( col1
    字符串,col2 字符串)存储为 ORC 位置 'wasb://container_name@STORATE_ACCOUNT_NAME.blob.core.windows.net/direc_name/' tblproperties ("orc.compress"="ZLIB");

    应该是正确的。

    您可能需要授予对服务主体的访问权限以在该存储上保存数据或访问您的存储资源管理器(来自 portal.azure)> 容器> 访问权限并允许用户执行该查询(您的服务主体)。

    如果您使用 hdinsights,您可以与我们分享具体错误。

    【讨论】:

      猜你喜欢
      • 2014-01-06
      • 2018-07-01
      • 1970-01-01
      • 2017-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-21
      • 1970-01-01
      相关资源
      最近更新 更多