Forum Discussion

Montxo61's avatar
Montxo61
New Member
3 years ago

Microsoft Fabric and Synapse Data Engineering Expl - to migrate functions in sql server funct

to migrate functions in sql server functions in lakehouse?

1 Reply

  • Hi Montxo61  Thanks for posting your question here 


    For more context I am assuming you are trying to migrate user defined funcitons from sql server,Please let us know otherwise

    Based on your strategy ,you may want to recreate  user defined sql server Functions over Lakehouse or Warehouse Over fabric ( totally depend on your architecture)

    In case of Warehouse then , there is Functions feature seems to be availiable which you might want to explore ( ps:- i havent explore this path that much)

     

    If your Strategy is to use Lakehouse then Notebooks are your best friend you may want to use these steps to recreate them 


    1. Identify the Function Logic:

     

    2. Convert the Logic to Spark friendly code :As notebooks usually support Spark friendly language like python or scala you will need to rewrite the logic in one of these languages.

     

    3. Use Spark SQL Functions Where Possible Check the Spark SQL function documentation to see if there are any that can simplify your function

    4.Use the Function in Your Notebook 

     

    Here is an simple example notebook to call udf functions 

    Code:

    Notebook attachted