简体   繁体   English

从 Azure BLOB 存储在 Azure SQL DW 中创建外部表

[英]Creating External Table in Azure SQL DW from Azure BLOB Storage

I am creating a data source in Azure SQL DW in order to create external table using BLOB storage data but I am getting error while creating data source.我正在 Azure SQL DW 中创建数据源,以便使用 BLOB 存储数据创建外部表,但在创建数据源时出现错误。 I am new to this polybase environment so, please share your thought.我是这个 polybase 环境的新手,所以请分享您的想法。

I am trying to call the data source in the external table code.我试图在外部表代码中调用数据源。

External Table外部表

create external table [DBA].[TEST]
(
[type] varchar(3) COLLATE   SQL_Latin1_General_CP1_CI_AS NULL,
)
with (LOCATION='https://test.blob.core.windows.net/BCP/',
DATA_SOURCE=TEST,
FILE_FORMAT=pipe_header,
REJECT_TYPE=VALUE,
REJECT_VALUE=0
)

I am not sure which KEY do I need to pass here as well.我不确定我也需要在这里传递哪个 KEY。 Either I need to use BLOB storage key or something else as well.我需要使用 BLOB 存储密钥或其他东西。

Data Source数据源

CREATE EXTERNAL DATA SOURCE TEST  
WITH (   
TYPE = BLOB_STORAGE,  
LOCATION = 'https://test.blob.core.windows.net/BCP/'
, CREDENTIAL = KEYS
)  
;

Error Code错误代码

Msg 103010, Level 16, State 1, Line 1
Parse error at line: 3, column: 16: Incorrect syntax near 'BLOB_STORAGE'.

Incorrect syntax near 'BLOB_STORAGE'. Expecting CEDS_HADOOP, CEDS_RDBMS, CEDS_SHARDMAPMANAGER, or CEDS_SHAREDMEMORY"

Expectation期待

I need to create external table in azure sql data warehouse using BLOB storage account.我需要使用 BLOB 存储帐户在 azure sql 数据仓库中创建外部表。

Confusingly TYPE=BLOB_STORAGE is not used in PolyBase, only in BULK INSERT/OPENROWSET from Azure SQL Database.令人困惑的是TYPE=BLOB_STORAGE未在 PolyBase 中使用,仅在来自 Azure SQL 数据库的 BULK INSERT/OPENROWSET 中使用。 Use TYPE=HADOOP , as in this walkthrough: Load Contoso Retail data to Azure SQL Data使用TYPE=HADOOP ,如本演练所示:将Contoso 零售数据加载到 Azure SQL 数据

CREATE EXTERNAL DATA SOURCE AzureStorage
WITH (
    TYPE = HADOOP,
    LOCATION = 'wasbs://<blob_container_name>@<azure_storage_account_name>.blob.core.windows.net',
    CREDENTIAL = AzureStorageCredential
);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM