Creating External Table over partitioned Delta Lake in Serverless SQL Pools

Serverless SQL 216 Reputation points MVP
2021-07-19T19:52:02.863+00:00

Hi,

I'm testing creating Views and External Tables over partitioned data in Azure Storage which is using the Delta Lake format. When I create a View and use the partitioned column in the delta lake to filter then I see reduced data processed (which is good). However when I create an External Table over the same partitioned Delta lake data, the partitioned column appears NULL in the results and filtering does not work.

For example:

CREATE EXTERNAL TABLE LDW.DeltaFactSalesOrder
(
CustomerKey int ,
ProductKey int ,
DueDateKey int ,
ShipDateKey int ,
OrderDate date,
SalesOrderNumber nvarchar(20)
)
WITH
(
LOCATION = 'spark/delta/factinternetsales/',
DATA_SOURCE = ExternalDataSourceDataWarehouse,
FILE_FORMAT = SynapseDeltaFormat
)

OrderDate is the partition column in the Delta Lake (created using the PARTITION BY spark sql syntax) but it's just NULL and doesn't seem to work when filtering.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
0 comments No comments
{count} vote

Answer accepted by question author
  1. KranthiPakala-MSFT 46,737 Reputation points Microsoft Employee Moderator
    2021-07-22T17:24:03.987+00:00

    Hi @Serverless SQL ,

    Apologies for the delayed response and thanks for using Microsoft Q&A forum and posting your query.

    As per conversation with product team, External tables do not support partitioned columns now, and it is recommend to use Views in that case. \

    Below are few related feedbacks in Azure Synapse Analytics user voice forum. Please feel free to up-vote and/or comment on them to help increase the priority of feature request.

    Hope this info helps.

    ----------

    Please don’t forget to Accept Answer and Up-Vote wherever the information provided helps you, this can be beneficial to other community members.


1 additional answer

Sort by: Most helpful
  1. Jayachandran, Athul 21 Reputation points
    2022-11-21T16:00:51.59+00:00

    Hi @KranthiPakala-MSFT ,

    I have a similar problem now , I created an external table with custom definitions, I am able to see all columns querying external table except for the ones used in partition, they are still NULL

    PFB

    ![262734-image.png]1

    Was this feature request rolled out post the above question, or is it still not available, could you help clarify. I just wanted to know if it is something in the datatype I created or not, doesn't seem so though.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.