When I create an External Table in unity catalog from a flattened csv folder, it works as expected:
CREATE EXTERNAL LOCATION IF NOT EXISTS raw_data
URL 'abfss://raw@storage0account0name.dfs.core.windows.net'
WITH ( STORAGE CREDENTIAL `a579a115-8958-.....`)
COMMENT 'RAW Data';
DROP TABLE IF EXISTS raw_files.<schema>.dw_agent;
CREATE TABLE raw_files.<schema>.dw_agent (
Retailer_ID STRING,
Retailer_Status INT,
Retailer_Status_Mapped STRING,
Retailer_Longitude DOUBLE
)
USING csv
OPTIONS (
'header' = 'true',
'sep' = '~',
'compression' = 'gzip' )
LOCATION 'abfss://temp@storage0account0name.dfs.core.windows.net/<schema>/DW/_flatten/dw_agent_file';
SELECT * FROM raw_files.<schema>.dw_agent_file LIMIT 1000
But if the CSV file is partitioned by Year/Date, I replace the LOCATION by:
'abfss://temp@storage0account0name.dfs.core.windows.net/<schema>/DW/_partitioned/dw_agent_file/*/*';
I'm getting the following error message:
Operation failed: "Server failed to authenticate the request.
Make sure the value of Authorization header is formed correctly including the signature."
, 403, GET, https://storage0account0name.dfs.core.windows.net/prod?upn=false&resource=filesystem&maxResults=5000&directory=folder_name/DW/dw_agent_file&timeout=90&recursive=false&st=2024-01-26T22:46:00Z&sv=2020-02-10&ske=2024-01-27T00:46:00Z&sig=XXXXX&sktid=910757d4-7f42-4cda-b0a2-b78bdde4c812&se=2024-01-27T00:43:27Z&sdd=5&skoid=a2301c4c-cef3-4ab8XXXXXXXXXXXXXXXXXX&spr=https&sks=b&skt=2024-01-26T22:46:00Z&sp=rl&skv=2020-02-10&sr=d, AuthenticationFailed, "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:19100423-001f-0009-12b1-501e2e000000 Time:2024-01-26T23:43:27.8051986Z"
- The storage account is the same, the only difference is the CSV file is now distributed in subfolders.
- I'm using the very same EXTERNAL LOCATION and CREDENTIALS.
There is any restriction to use partitioned csv's as external tables? I couldn't find find a single example in this scenario.
Thanks for helping.