External table issue

Rohit Kulkarni 731 Reputation points
2022-09-28T12:41:13.997+00:00

Hello Team,

I am using df.write command and the table is getting created.

245572-image.png

If you refer the below screenshot the table got created in Tables folder in dedicated sql pool. But i required in the External Tables folder.

245574-image.png

The script is used :

%python
tempDir = "abfss://*****@Storagename.dfs.core.windows.net/temp/salesforce/location"
tableName = "Salesforce.Location120"
serverName = "xyz.sql.azuresynapse.net"
dbName = "tbuesynwbiscwe1"
jdbcURL = "jdbc:sqlserver://xyz.sql.azuresynapse.net:1433;database=abc;encrypt=true;trustServerCertificate=true;hostNameInCertificate=
.sql.azuresynapse.net;loginTimeout=30;Authentication=ActiveDirectoryIntegrated;external.table.purge=true;DataSource=tbueabfsbiscwe1_tbuestbiscwe1_dfs_core_windows_net;FileFormat=SynapseParquetFormat"

df.write \
.format("com.databricks.spark.sqldw") \
.option("url", jdbcURL) \
.option("enableServicePrincipalAuth", "true") \
.mode("overwrite") \
.option("dbTable", tableName) \
.option("tempDir", tempDir) \
.save()

Regards
Rk

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.
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
{count} vote

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.