Forum Discussion
External table Creation in Fabric
I'm curious why you want to create an external table?
In general, the preferred format in Fabric is a managed delta table. This ensures the best interoperability across the Fabric platform.
For reference, sample code to create an external table with delta format is shown below, however in general I would choose to use a managed delta table:
%%sql
CREATE TABLE FactInternetSales_ext (
CustomerID STRING,
ProductID STRING,
CurrencyID STRING,
SalesAmount STRING,
....
) USING DELTA OPTIONS (path 'Files/FactInternetSales_ext');
I am facing an identifier issue when using a shortcut table in Fabric for a Parquet file, which is preventing the table from being displayed. To resolve this, I want to create an external table, as it could potentially fix the problem.
I will definitely try the approach you shared, but please provide an alternative approach that can address this issue.
Thank you.
- frithjof_v1 year agoCommunity Champion
I'm curious why you got the identifier issue. Did the error message tell more?
(In case you share more details, please don't share any sensitive or secret information).Regarding the external table with parquet as a source - this worked for me:
spark.sql(""" CREATE EXTERNAL TABLE IF NOT EXISTS table_name ( column_name COLUMN_TYPE, another_column_name COLUMN_TYPE, another_column_name COLUMN_TYPE ) STORED AS PARQUET LOCATION 'Files/folder_name/another_folder_name' """)Here is another one, very similar: