<?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: Correlated column is not allowed in non  predicate in UDF SQL in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46265#M28025</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/89918"&gt;@Databricks143&lt;/a&gt;&amp;nbsp;Are you running the query in DBSQL or in notebook?&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2023 10:51:49 GMT</pubDate>
    <dc:creator>Noopur_Nigam</dc:creator>
    <dc:date>2023-09-26T10:51:49Z</dc:date>
    <item>
      <title>Correlated column is not allowed in non  predicate in UDF SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46160#M28012</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;I am new to databricks and currently working on creating sql udf 's&amp;nbsp; in databricks .&lt;/P&gt;&lt;P&gt;In udf we are calculating min date and that date column using in where clause also.&lt;/P&gt;&lt;P&gt;While running udf getting&amp;nbsp;&amp;nbsp;Correlated column is not allowed in&amp;nbsp; non predicate&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: In Udf we are calling as below&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select min(hiredate) from&amp;nbsp;&lt;SPAN&gt;Emp where empno=&amp;amp;1&amp;nbsp; and hiredate&amp;lt;=&amp;amp;2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;amp;1 and &amp;amp;2 are function input&amp;nbsp; parameters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Request you please help me on this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 17:28:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46160#M28012</guid>
      <dc:creator>Databricks143</dc:creator>
      <dc:date>2023-09-25T17:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Correlated column is not allowed in non  predicate in UDF SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46265#M28025</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/89918"&gt;@Databricks143&lt;/a&gt;&amp;nbsp;Are you running the query in DBSQL or in notebook?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 10:51:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46265#M28025</guid>
      <dc:creator>Noopur_Nigam</dc:creator>
      <dc:date>2023-09-26T10:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Correlated column is not allowed in non  predicate in UDF SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46267#M28027</link>
      <description>&lt;P&gt;&amp;nbsp;I am running in notebook.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 10:55:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46267#M28027</guid>
      <dc:creator>Databricks143</dc:creator>
      <dc:date>2023-09-26T10:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Correlated column is not allowed in non  predicate in UDF SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46269#M28029</link>
      <description>&lt;P&gt;Could you please provide your full code? I would also like to know which DBR version you are using in your cluster.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 10:58:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46269#M28029</guid>
      <dc:creator>Noopur_Nigam</dc:creator>
      <dc:date>2023-09-26T10:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Correlated column is not allowed in non  predicate in UDF SQL</title>
      <link>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46347#M28050</link>
      <description>&lt;P&gt;Please find below query and DBR version that we are using in cluster&lt;/P&gt;&lt;P&gt;%sql&lt;/P&gt;&lt;P&gt;create or replace function first_con_date(&lt;BR /&gt;indicator String,&lt;BR /&gt;startingdate Date,&lt;BR /&gt;transingdate Date,&lt;BR /&gt;status String,&lt;BR /&gt;entid String,&lt;BR /&gt;bookingid String,&lt;BR /&gt;ftype String,&lt;BR /&gt;transfertype String)&lt;BR /&gt;Returns&lt;BR /&gt;Date&lt;BR /&gt;return&lt;BR /&gt;case when indicator ='Y' then&lt;BR /&gt;(select min(Trans_date)&lt;BR /&gt;from transfer&lt;BR /&gt;where statusflag=status&lt;BR /&gt;and Transid=entid&lt;BR /&gt;and methodid=bookingid&lt;BR /&gt;and fintype=ftype&lt;BR /&gt;and trans_type=transfertype&lt;BR /&gt;and trans_date&amp;lt;=transingdate)&lt;BR /&gt;else&lt;BR /&gt;add_months(startingdate,-1)&lt;/P&gt;&lt;P&gt;DBR Version:- 9.1LTS(includes Apache Spark 3.1.2,Scala 2.12)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 03:52:34 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/correlated-column-is-not-allowed-in-non-predicate-in-udf-sql/m-p/46347#M28050</guid>
      <dc:creator>Databricks143</dc:creator>
      <dc:date>2023-09-27T03:52:34Z</dc:date>
    </item>
  </channel>
</rss>

