创建外部表时出现错误
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'xxxxx'
CREATE DATABASE SCOPED CREDENTIAL ADLUser
WITH IDENTITY = xxxxx@/https://login.microsoftonline.com/xxxxx/oauth2/v2.0/token',
SECRET = xxxxx' ;
CREATE EXTERNAL DATA SOURCE AzureDataLakeStore
WITH (TYPE = HADOOP,
CREDENTIAL = ADLUser,
LOCATION = N'adl://xxxxx.azuredatalakestore.net'
)
CREATE EXTERNAL FILE FORMAT TextFileFormat
WITH (
FORMAT_TYPE = DELIMITEDTEXT,
FORMAT_OPTIONS (FIELD_TERMINATOR =',',
STRING_DELIMITER = '"',
USE_TYPE_DEFAULT = TRUE)
);
CREATE EXTERNAL TABLE [dbo].[xxxxx_external](
[EventMonth] [nvarchar](10) NULL,
[UserCount] [bigint] NULL,
[UserType] [nchar](8) NULL,
[StageType] [bigint] NULL,
[StageName] [nvarchar](9) NULL)
WITH
(
LOCATION=N'/test/xxxxx.csv',
DATA_SOURCE = AzureDataLakeStore ,
FILE_FORMAT = TextFileFormat
) ;
CREATE TABLE [dbo].[xxxxx]
WITH (DISTRIBUTION = HASH([EventMonth] ) )
AS SELECT * FROM
[dbo].[xxxxx_external] ;
运行 CREATE EXTERNAL TABLE 时无法执行查询。错误:由于内部错误,外部文件访问失败:'访问 HDFS 时发生错误:调用 HdfsBridge_IsDirExist 时引发 Java 异常。Java 异常消息:
HdfsBridge::isDirExist - 检查目录是否存在时遇到意外错误:MalformedURLException: no protocol: / https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/v2.0/token '