<?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: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34904#M25597</link>
    <description>&lt;P&gt;hi @Manoj Kumar Rayalla​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like @Hubert Dudek​&amp;nbsp; mentioned, make sure to check what is the exact location for your Jar file. Make sure to list your path first to check if the file it located in the right location.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 16:19:32 GMT</pubDate>
    <dc:creator>jose_gonzalez</dc:creator>
    <dc:date>2021-11-18T16:19:32Z</dc:date>
    <item>
      <title>Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34900#M25593</link>
      <description>&lt;P&gt;Hi Team, When i am trying to register a permanant function i am getting the below error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;CREATE FUNCTION simple_udf AS 'SimpleUdf'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;USING JAR '/tmp/SimpleUdf.jar';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;select simple_udf(2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error Details : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;com.databricks.backend.common.rpc.DatabricksExceptions$SQLExecutionException: org.apache.spark.sql.AnalysisException: Can not load class 'SimpleUdf' when registering the function 'default.simple_udf', please make sure it is on the classpath; &lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 02:37:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34900#M25593</guid>
      <dc:creator>Manoj</dc:creator>
      <dc:date>2021-11-18T02:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34902#M25595</link>
      <description>&lt;P&gt;it seems the cluster cannot find the jar.  My guess is your path is incorrect/incomplete or as the error says it: you have to let the cluster know where the jar can be found (classpath)&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 08:14:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34902#M25595</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-11-18T08:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34903#M25596</link>
      <description>&lt;P&gt;probably correct path is /dbfs/tmp/SimpleUdf.jar&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 11:19:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34903#M25596</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2021-11-18T11:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34904#M25597</link>
      <description>&lt;P&gt;hi @Manoj Kumar Rayalla​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like @Hubert Dudek​&amp;nbsp; mentioned, make sure to check what is the exact location for your Jar file. Make sure to list your path first to check if the file it located in the right location.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 16:19:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34904#M25597</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2021-11-18T16:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34905#M25598</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the Suggestions  @Werner Stinckens​&amp;nbsp; @Jose Gonzalez​&amp;nbsp;&lt;/P&gt;&lt;P&gt; @Hubert Dudek​&amp;nbsp; . No luck in changing the path &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did anyone else got the same error while creating permanent functions using python script? I see java and scala has documentation but not python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manoj &lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 16:41:42 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34905#M25598</guid>
      <dc:creator>Manoj</dc:creator>
      <dc:date>2021-11-18T16:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34906#M25599</link>
      <description>&lt;P&gt;Hi @Kaniz Fatma​&amp;nbsp;, Nice meeting you! Have you got a chance to create permanent functions in data bricks using python scripts, I am trying to anonymize the data  using permanent views and permanent functions.. but i am having trouble in creating permanent functions &lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 16:44:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34906#M25599</guid>
      <dc:creator>Manoj</dc:creator>
      <dc:date>2021-11-18T16:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34907#M25600</link>
      <description>&lt;P&gt;ok now I see the issue: you want to use python, but provide a jar (for java/scala).&lt;/P&gt;&lt;P&gt;I remember &lt;A href="https://community.databricks.com/s/question/0D53f00001PAdGyCAL/create-function-from-python-file" alt="https://community.databricks.com/s/question/0D53f00001PAdGyCAL/create-function-from-python-file" target="_blank"&gt;another post asking for sql functions in  python&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would think the USING FILE would work.&lt;/P&gt;&lt;P&gt;As long as you follow the class_name requirements.&lt;/P&gt;&lt;P&gt;&lt;I&gt;The implementing class should extend one of the base classes as follows:&lt;/I&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;I&gt;Should extend UDF or UDAF in org.apache.hadoop.hive.ql.exec package.&lt;/I&gt;&lt;/LI&gt;&lt;LI&gt;&lt;I&gt;Should extend AbstractGenericUDAFResolver, GenericUDF, or GenericUDTF in org.apache.hadoop.hive.ql.udf.generic package.&lt;/I&gt;&lt;/LI&gt;&lt;LI&gt;&lt;I&gt;Should extend UserDefinedAggregateFunction in org.apache.spark.sql.expressions package.&lt;/I&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also the docs literally state python is possible:&lt;/P&gt;&lt;P&gt;&lt;I&gt;In addition to the SQL interface, Spark allows you to create custom user defined scalar and aggregate functions using Scala, Python, and Java APIs. See &lt;/I&gt;&lt;A href="https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-functions-udf-scalar.html" alt="https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-functions-udf-scalar.html" target="_blank"&gt;&lt;I&gt;User-defined scalar functions (UDFs)&lt;/I&gt;&lt;/A&gt;&lt;I&gt; and &lt;/I&gt;&lt;A href="https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-functions-udf-aggregate.html" alt="https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-functions-udf-aggregate.html" target="_blank"&gt;&lt;I&gt;User-defined aggregate functions (UDAFs)&lt;/I&gt;&lt;/A&gt;&lt;I&gt; for more information.&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 17:15:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34907#M25600</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-11-18T17:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34909#M25602</link>
      <description>&lt;P&gt;Hi @Werner Stinckens​&amp;nbsp;, Yes i followed the same instructions and was trying to solve this with a java program then later planning to convert python script to a jar file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the program that i used , Using Eclipse i was able to generate the .jar file successfully by adding "org.apache.hadoop.hive.ql.exec.UDF" this class related jar into the project,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; import org.apache.hadoop.hive.ql.exec.UDF;&lt;/P&gt;&lt;P&gt; public class SimpleUdf extends UDF {&lt;/P&gt;&lt;P&gt; public int evaluate(int value) {&lt;/P&gt;&lt;P&gt; return value + 10;&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jar file Link : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.java2s.com/Code/Jar/h/Downloadhive041jar.htm" alt="http://www.java2s.com/Code/Jar/h/Downloadhive041jar.htm" target="_blank"&gt;http://www.java2s.com/Code/Jar/h/Downloadhive041jar.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then tried the below commands &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;CREATE FUNCTION simple_udf AS 'SimpleUdf'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;USING JAR '/tmp/SimpleUdf.jar';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;CREATE FUNCTION simple_udf AS 'SimpleUdf'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;USING JAR '/dbfs/tmp/SimpleUdf.jar';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;select simple_udf(2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I placed it on the File Store of data bricks cluster and it kept throwing the same error, please make sure the class path is correct. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 23:21:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34909#M25602</guid>
      <dc:creator>Manoj</dc:creator>
      <dc:date>2021-11-18T23:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34910#M25603</link>
      <description>&lt;P&gt;Hi @Werner Stinckens​&amp;nbsp;, Yes i followed the same instructions and was trying to solve this first for java program then later planning to convert python script to a jar file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the program that i used , Using Eclipse i was able to generate the .jar file successfully by adding "org.apache.hadoop.hive.ql.exec.UDF" this class file related jar into the project,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import org.apache.hadoop.hive.ql.exec.UDF;&lt;/P&gt;&lt;P&gt;public class SimpleUdf extends UDF {&lt;/P&gt;&lt;P&gt;public int evaluate(int value) {&lt;/P&gt;&lt;P&gt;return value + 10;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jar file Link :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.java2s.com/Code/Jar/h/Downloadhive041jar.htm" alt="http://www.java2s.com/Code/Jar/h/Downloadhive041jar.htm" target="_blank"&gt;http://www.java2s.com/Code/Jar/h/Downloadhive041jar.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I placed it on the File Store of data bricks cluster and kept throwing the same error, please make sure the class path is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see you are from Data Bricks did you guys any documentation that helps me understand with an example...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is there but its not clear &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-syntax-ddl-create-function.html" target="test_blank"&gt;https://docs.databricks.com/spark/latest/spark-sql/language-manual/sql-ref-syntax-ddl-create-function.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 23:23:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34910#M25603</guid>
      <dc:creator>Manoj</dc:creator>
      <dc:date>2021-11-18T23:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34911#M25604</link>
      <description>&lt;P&gt;Ok, so I tried your example myself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue lies within your jar.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;the jar you provide is not called 'SimpleUdf.jar' but 'hive_0_4_1.jar'.&lt;/LI&gt;&lt;LI&gt;your jar should contain a class called 'SimpleUdf', but there is no such function in there.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I used your jar and tried myself, using a class which is in the jar:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2319i88D84D60C5037FFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2311iEC86DBB240FC6F6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What this function does, I have no idea. But it is important that you point to an existing class, and take the complete name, not only the last part (so in this case org.apache.hadoop.hive.ql.udf.UDFLog and not just UDFLog).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 07:15:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34911#M25604</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2021-11-19T07:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34912#M25605</link>
      <description>&lt;P&gt;hi @Werner Stinckens​&amp;nbsp; @Jose Gonzalez​&amp;nbsp; @Hubert Dudek​&amp;nbsp;@Kaniz Fatma​&amp;nbsp;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;Thanks for all the help, Appreciate it. I was able to create permanent functions  and use eclipse to  create the runnable jar. However, Does anyone have any idea on how to deploy the jar on SQL End Point Cluster.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 21:45:16 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34912#M25605</guid>
      <dc:creator>Manoj</dc:creator>
      <dc:date>2022-01-26T21:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34913#M25606</link>
      <description>&lt;P&gt;I doubt if that is possible at the moment, it would also go against the use of photon (which is C++).&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 08:14:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34913#M25606</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2022-01-27T08:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34914#M25607</link>
      <description>&lt;P&gt;As SQL End Point is serverless I doubt it is possible &lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 13:10:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34914#M25607</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-01-27T13:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Did any one in the community create Permanent Functions using using python script ? I tried but i am getting the below error, Please advise</title>
      <link>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34915#M25608</link>
      <description>&lt;P&gt;Hi @Manoj Kumar Rayalla​&amp;nbsp;Would you please share how did you manage to resolve the issue at your side. I am facing the same error. I already had tried the above suggested details but no luck so far.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 18:24:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/did-any-one-in-the-community-create-permanent-functions-using/m-p/34915#M25608</guid>
      <dc:creator>Sandy126</dc:creator>
      <dc:date>2022-06-14T18:24:29Z</dc:date>
    </item>
  </channel>
</rss>

