3

I have a parquet format table stored in stored in azure data lake gen2 which is directly connected to an external table in azure synapse. I am trying to formulate a logic in sql language which will read the schema of that parquet file table and paste it on external table column names dynamically.

Let me know if you have any ideas/ logic for it.

1 Answers1

3

Using Data Lake exploration capabilities of Synapse Studio you can now create and query an external table using Synapse SQL pool with a simple right-click on the file. The one-click gesture to create external tables from the ADLS Gen2 storage account is only supported for Parquet files.

I repro the requirement using sample parquet file. As required, file is stored in Data Lake Lake Gen2 which is linked with Synapse Workspace.

enter image description here

From the Data panel, select the file that you would like to create the external table from:

enter image description here

A dialog window will open. Select dedicated SQL pool or serverless SQL pool, give a name to the table and select open script:

enter image description here

The SQL Script is autogenerated inferring the schema from the file. The script will read the column names from parquet file. You can edit the column names and run the script. The script will automatically run a Select Top 100 *.:

enter image description here

Utkarsh Pal
  • 4,079
  • 1
  • 5
  • 14