簡體   English   中英

使用憑據在 Hive 上為 Azure Blob 創建 EXTERNAL 表

[英]Creating EXTERNAL Table on Hive for Azure Blob with credentials

我們在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");

我想在創建表語法中設置我的存儲訪問密鑰,以便我可以訪問多個存儲帳戶而不是在 core-site.xml 中定義憑據

如果不存在則創建外部表 Table_WASB ( col1
string, col2 string ) 存儲為 ORC LOCATION 'wasb://container_name@STORATE_ACCOUNT_NAME.blob.core.windows.net/direc_name/' tblproperties (" orc.compress "="ZLIB");

它應該是正確的。

可能您需要授予對服務主體的訪問權限以保存該存儲上的數據或訪問存儲資源管理器(來自 portal.azure)> 容器 > 訪問權限並允許用戶執行該查詢(您的服務主體)。

如果您使用 hdinsights,您可以與我們分享具體的錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM