EXTERNAL TABLE access failed due to internal error: 'Java exception raised on call to HdfsBridge_IsDirExist. Java exception message:

ravi kiran picture ravi kiran · Jan 20, 2017 · Viewed 9.9k times · Source

I am trying to create external table through polybase with below syntax on Visual Studio 2015. Its giving me the below error. Can some one pls help on this

CREATE EXTERNAL TABLE dbo.DimDate2External (
    DateId INT NOT NULL,
    CalendarQuarter TINYINT NOT NULL,
    FiscalQuarter TINYINT NOT NULL
)
WITH (
    LOCATION='/textfiles/DimDate2.txt',
    DATA_SOURCE=AzureStorage,
    FILE_FORMAT=TextFile
);

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

CREATE EXTERNAL FILE FORMAT TextFile WITH ( FORMAT_TYPE = DelimitedText, FORMAT_OPTIONS (FIELD_TERMINATOR = ',') );

EXTERNAL TABLE access failed due to internal error:

'Java exception raised on call to HdfsBridge_IsDirExist. Java exception message: com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.: Error [com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.] occurred while accessing external file.'

Answer

ravi kiran picture ravi kiran · Jan 23, 2017

In the 'LOCATION' syntax I mistakenly misplaced the Blob container and Storage account and got this error. Now its fixed.

CREATE EXTERNAL DATA SOURCE AzureStorage WITH ( TYPE = HADOOP, LOCATION = 'wasbs://@.‌​blob.core.windows.ne‌​t', CREDENTIAL = AzureStorageCredential )