我找不到关于如何将带有外部表的 CSV 文件直接加载到 Sql 数据仓库中的完整示例。该文件位于存储帐户https://tstodummy.blob.core.windows.net/ Blob 容器参考数据中,文件夹 csv-uploads,文件 something.csv。这是我的代码
CREATE DATABASE SCOPED CREDENTIAL tstodummy_refdata_credential
WITH IDENTITY = 'USER',
SECRET = '....'
GO
CREATE EXTERNAL DATA SOURCE tstodummy_referencedata
WITH ( TYPE = HADOOP,
LOCATION = 'wasb://referencedata-in@tstodummy.blob.core.windows.net',
CREDENTIAL = tstodummy_refdata_credential);
GO
CREATE EXTERNAL FILE FORMAT aps_bma_referencedata_ff
WITH (FORMAT_TYPE = DELIMITEDTEXT,
FORMAT_OPTIONS(
FIELD_TERMINATOR = ';',
STRING_DELIMITER = '"',
FIRST_ROW = 2,
USE_TYPE_DEFAULT = True)
)
CREATE EXTERNAL TABLE [stg_aps_bma_refdata].[PlanDeMaintenance]
( [Version] VARCHAR(255) NULL
, [Description] VARCHAR(255) NULL
, [Date_Start] VARCHAR(255) NULL
, [Date_Stop] VARCHAR(255) NULL
) WITH ( LOCATION = '\referencedata-in\csv-uploads\PlanDeMaintanance'
, DATA_SOURCE = tstodummy_referencedata
, FILE_FORMAT = aps_bma_referencedata_ff
, REJECT_TYPE = VALUE
, REJECT_VALUE = 0
)
我一直在使用 Location 中的各种组合......但是,Nogo 错误是
Msg 105002, Level 16, State 1, Line 26
EXTERNAL TABLE access failed because the specified path name '/referencedata-in/csv-uploads/PlanDeMaintanance.csv' does not exist. Enter a valid path and try again.