简体   繁体   中英

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. I am new to this polybase environment so, please share your thought.

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. Either I need to use BLOB storage key or something else as well.

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.

Confusingly TYPE=BLOB_STORAGE is not used in PolyBase, only in BULK INSERT/OPENROWSET from Azure SQL Database. Use TYPE=HADOOP , as in this walkthrough: Load Contoso Retail data to Azure SQL Data

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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