<?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>question Re: OR operator not supported in Impala in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24587#M4938</link>
    <description>&lt;P&gt;First, the reason why the query is rejected is because Impala currently has no efficient way to process that join. Impala only implements&amp;nbsp;hash join and disjunctoive conditions (with OR) are not hashable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That said, since Impala 2.0 we do support executing such queries, albeit inefficiently. They will be run via a CROSS JOIN + filter, so I'd advise against running such queries on very large tables. Earlier Impala versions cannot run your query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Feb 2015 07:13:08 GMT</pubDate>
    <dc:creator>alex.behm</dc:creator>
    <dc:date>2015-02-12T07:13:08Z</dc:date>
    <item>
      <title>OR operator not supported in Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24586#M4937</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have two tables in impala,in first table one of the column&amp;nbsp; is mobile number and second table I have country_code and country_name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Table events&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column1 Column2 .... CallingNumber&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CalledNumber....Columnn&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Some Data&amp;nbsp; ......&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 917878999777&amp;nbsp;&amp;nbsp;&amp;nbsp; 2347878999777&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Table l_countrycode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Country_Code&amp;nbsp;&amp;nbsp; Country_Name&lt;/P&gt;&lt;P&gt;------------------------------------------&lt;/P&gt;&lt;P&gt;91&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; India&lt;/P&gt;&lt;P&gt;234&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nigeria&lt;/P&gt;&lt;P&gt;7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kazakhastan&lt;/P&gt;&lt;P&gt;....More data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;So I have to join two tables on the basis of country code and country code can be of 1,2,3,and 4 digits.I have to extract country code from the mobile number write the following logic to join two tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select column1,colum2....&lt;/P&gt;&lt;P&gt;from events e,l_countrycode vcc2&lt;BR /&gt;where&amp;nbsp;substring(e.callednumber,1,1)= vcc2.country_code in or substring(e.callednumber,1,2)=vcc2.country_code&lt;/P&gt;&lt;P&gt;or substring(e.callednumber,1,3)=vcc2.country_code or substring(e.callednumber,1,4))=vcc2.country_code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The preceding code does not run,so I try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select column1,colum2....&lt;/P&gt;&lt;P&gt;from events e,l_countrycode vcc2&lt;BR /&gt;where&amp;nbsp; vcc2.country_code in(substring(e.callednumber,1,1),substring(e.callednumber,1,2),substring(e.callednumber,1,3),&lt;BR /&gt;substring(e.callednumber,1,4))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both query returns error&lt;/P&gt;&lt;P&gt;NotImplementedException: Join between 'e' and 'vcc2' requires at least one conjunctive equality predicate between the two tables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only option I left with is to use UNION but the table contains millions of data and it will hinder performance and affect memory. So please help&lt;/P&gt;&lt;P&gt;me how can I achieve my target without UNION as the above query runs fine in MYSQL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:21:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24586#M4937</guid>
      <dc:creator>Moazzam</dc:creator>
      <dc:date>2022-09-16T09:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: OR operator not supported in Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24587#M4938</link>
      <description>&lt;P&gt;First, the reason why the query is rejected is because Impala currently has no efficient way to process that join. Impala only implements&amp;nbsp;hash join and disjunctoive conditions (with OR) are not hashable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That said, since Impala 2.0 we do support executing such queries, albeit inefficiently. They will be run via a CROSS JOIN + filter, so I'd advise against running such queries on very large tables. Earlier Impala versions cannot run your query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Feb 2015 07:13:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24587#M4938</guid>
      <dc:creator>alex.behm</dc:creator>
      <dc:date>2015-02-12T07:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: OR operator not supported in Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24649#M4939</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp; I found an alternative solution&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from events e&amp;nbsp; JOIN l_CountryCode vcc1 on (substring(e.callingnumber,1,1)=substring(vcc1.country_code,1,1)&lt;BR /&gt;and substring(e.callingnumber,1,length(vcc1.country_code))=vcc1.country_code)&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2015 07:13:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24649#M4939</guid>
      <dc:creator>Moazzam</dc:creator>
      <dc:date>2015-02-13T07:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: OR operator not supported in Impala</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24652#M4940</link>
      <description>&lt;P&gt;Thanks for following up! Glad you solved the issue,&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2015 07:38:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/OR-operator-not-supported-in-Impala/m-p/24652#M4940</guid>
      <dc:creator>alex.behm</dc:creator>
      <dc:date>2015-02-13T07:38:43Z</dc:date>
    </item>
  </channel>
</rss>

