I am trying to create a view in azure synapse, but it is throwing an error. The query I am using to create view:
CREATE VIEW view_name
AS
SELECT * FROM
openrowset(bulk '/some_path/delta_table_name',
data_source = 'sample',
format='delta') as a;
The error it is throwing:
Column mapping is not enabled.
I have created delta table like this using databricks:
df.write.format('delta').mode('overwrite').save("abfss://containername@storagename.dfs.core.windows.net/sample/some_path/delta_table_name")
Why I am getting this error? and How can I fix this?
After solving this issue : Azure Databricks creating unnecessary folders, the above one automatically got resolved.
The issue was that databricks was creating some unknown folder while writing or merging data to azure cloud. After resolving that issue, I was able to create view correctly.
And why databricks creating unknown folder is because of the delta version more than 2, and column mapping mode has been set to "name". As per documentation, "Serverless SQL pools in Synapse Analytics are compatible with Delta reader version 1. The Delta features that require Delta readers with version 2 or higher (for example column mapping) are not supported in the serverless SQL pools."
Reference: [Column Mapping not enabled][1]
[1]: https://learn.microsoft.com/en-us/answers/questions/1352015/synapse-sql-serverless-pool-)-column-mapping-in-de