<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: UDF already defined error when using it into a DLT pipeline in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/udf-already-defined-error-when-using-it-into-a-dlt-pipeline/m-p/101306#M40625</link>
    <description>&lt;P&gt;Now the&amp;nbsp;&lt;SPAN&gt;Python UDF support is currently in public preview, and it is supported in the current channel as well. Could you please try to re-run the code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://docs.databricks.com/en/delta-live-tables/unity-catalog.html" target="_blank"&gt;https://docs.databricks.com/en/delta-live-tables/unity-catalog.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 07 Dec 2024 06:02:32 GMT</pubDate>
    <dc:creator>Mounika_Tarigop</dc:creator>
    <dc:date>2024-12-07T06:02:32Z</dc:date>
    <item>
      <title>UDF already defined error when using it into a DLT pipeline</title>
      <link>https://community.databricks.com/t5/data-engineering/udf-already-defined-error-when-using-it-into-a-dlt-pipeline/m-p/55513#M30355</link>
      <description>&lt;P&gt;I'm using Unity catalog and defined some UDFs in my catalog.database, as reported by&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;show functions in main.default
main.default.getgender
main.default.tointlist
main.default.tostrlist&lt;/LI-CODE&gt;&lt;P&gt;I can use them from a start warehouse pro:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT main.default.get_gender(10,80,10)&lt;/LI-CODE&gt;&lt;P&gt;The above statement works.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;However, from inside a pipeline:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@dlt.view(
name="vudf"
,comment="Extra data collected from sensor tower APIs required to build the silver table"
)
def test():
   return SQL("""
SELECT ${env.database}.get_gender(10, 80 ,20)
""")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I got:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;pyspark.errors.exceptions.AnalysisException: [ROUTINE_ALREADY_EXISTS] Cannot create the function `main`.`default`.`get_gender` because it already exists.
Choose a different name, drop or replace the existing function, or add the IF NOT EXISTS clause to tolerate a pre-existing function.; line 2 pos 15&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 19 Dec 2023 17:27:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/udf-already-defined-error-when-using-it-into-a-dlt-pipeline/m-p/55513#M30355</guid>
      <dc:creator>6502</dc:creator>
      <dc:date>2023-12-19T17:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: UDF already defined error when using it into a DLT pipeline</title>
      <link>https://community.databricks.com/t5/data-engineering/udf-already-defined-error-when-using-it-into-a-dlt-pipeline/m-p/101306#M40625</link>
      <description>&lt;P&gt;Now the&amp;nbsp;&lt;SPAN&gt;Python UDF support is currently in public preview, and it is supported in the current channel as well. Could you please try to re-run the code.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://docs.databricks.com/en/delta-live-tables/unity-catalog.html" target="_blank"&gt;https://docs.databricks.com/en/delta-live-tables/unity-catalog.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2024 06:02:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/udf-already-defined-error-when-using-it-into-a-dlt-pipeline/m-p/101306#M40625</guid>
      <dc:creator>Mounika_Tarigop</dc:creator>
      <dc:date>2024-12-07T06:02:32Z</dc:date>
    </item>
  </channel>
</rss>

