0

In Azure Synapse Analytics, I want to keep my SQL queries separately from my PySpark notebook.

So I have created some SQL scripts. And I would like to use them in my PySpark notebook.

  • Is it possible ?
  • And what is the python code to load a SQL script into a variable ?

Notebooks and SQL Scripts in Azure Synapse Analytics

Sybaris
  • 41
  • 5
  • Just load as a text file and pass the text to the your query code. A better question would be how to load files from Azure Synapse via a notebook there. I assume you can find that answer online. – Danny Varod Nov 09 '22 at 10:41

1 Answers1

1

As I undertand the ask here , is can we read the SQL scripts which we have already created from pysprk notebook . I was looking at the storage account whiched is mapped to my synapse analytics studio ( ASA) and i do not see that the notebook or SQL scripts are stored there . So i dont think you can convert the existing SQL script to Pyspark code within the ASA . Yes if you export the SQL scripts and then upload to storage and then read the scripts from the notebook .

HimanshuSinha
  • 1,650
  • 2
  • 6
  • 10