<?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: Impala multiple Key values in where clause with complex type map in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395241#M248900</link>
    <description>&lt;P&gt;In your where clause:&lt;/P&gt;&lt;PRE&gt;r.key=’street’ AND r.value=’abc’ AND r.key=’phone’ AND r.value=’123’&lt;/PRE&gt;&lt;P&gt;you are using the "and" operator between all the conditions. That would select a row/record where all of these conditions are true at the same time, but there are no such records. I think that's why you are getting empty results. You should use "OR" between conditions that applies to different rows, like:&lt;/P&gt;&lt;PRE&gt;(r.key=’street’ AND r.value=’abc’) OR (r.key=’phone’ AND r.value=’123’)&lt;/PRE&gt;</description>
    <pubDate>Tue, 15 Oct 2024 14:32:52 GMT</pubDate>
    <dc:creator>zegab</dc:creator>
    <dc:date>2024-10-15T14:32:52Z</dc:date>
    <item>
      <title>Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395018#M248845</link>
      <description>&lt;DIV class="s-prose js-post-body"&gt;&lt;P&gt;I am having a table&lt;/P&gt;&lt;PRE&gt;id  | result
Int | map&amp;lt;string, string&amp;gt;

Id  | result
1   | {”street”:”abc”, ”phone”:”123”}
2   | {”country”:”def”, ”phone”:”456”}
3   | {”street”:”abc”, ”zipCode”:”726”}
4   | {”street”:”abc”, ”phone”:”123”}
5   | {”street”:”fgh”, ”phone”:”123”}&lt;/PRE&gt;&lt;P&gt;I would like to get records with street=abc and phone=123&lt;/P&gt;&lt;P&gt;I wrote the query like below:&lt;/P&gt;&lt;PRE&gt;select id, r
from table, table.result r
where r.key=’street’ and r.value=’abc’
and r.key=’phone’ and r.value=’123’&lt;/PRE&gt;&lt;P&gt;The result is empty&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class="mt24 mb12"&gt;&lt;DIV class="post-taglist d-flex gs4 gsy fd-column"&gt;&lt;DIV class="d-flex ps-relative fw-wrap"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 11 Oct 2024 12:04:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395018#M248845</guid>
      <dc:creator>Kjarzyna</dc:creator>
      <dc:date>2024-10-11T12:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395055#M248850</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/118630"&gt;@Kjarzyna&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our Impala experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/81584"&gt;@jAnshula&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/8448"&gt;@Boris G&lt;/a&gt;&amp;nbsp; who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2024 15:43:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395055#M248850</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2024-10-11T15:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395082#M248858</link>
      <description>&lt;P&gt;Hello-&lt;/P&gt;&lt;P&gt;Please see&amp;nbsp;&lt;A href="https://impala.apache.org/docs/build/html/topics/impala_complex_types.html#complex_sample_schema" target="_blank"&gt;https://impala.apache.org/docs/build/html/topics/impala_complex_types.html#complex_sample_schema&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;for the correct schema definitions as well as examples of queries against complex data structures like ARRAY and MAP (which is implemented very similar to ARRAY in Impala).&lt;BR /&gt;&lt;BR /&gt;Let me know if that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Oct 2024 01:06:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395082#M248858</guid>
      <dc:creator>Boris G</dc:creator>
      <dc:date>2024-10-13T01:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395106#M248867</link>
      <description>&lt;P&gt;Yes I saw the documentation, but i didn’t find solution there. In documentation you usually add just one map field and value into where clause&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2024 06:24:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395106#M248867</guid>
      <dc:creator>Kjarzyna</dc:creator>
      <dc:date>2024-10-14T06:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395229#M248897</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/118630"&gt;@Kjarzyna&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Yes I saw the documentation, but i didn’t find solution there. In documentation you usually add just one map field and value into where clause&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/118630"&gt;@Kjarzyna&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;If you just add one single map key or value to the where clause, does your query work?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 13:19:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395229#M248897</guid>
      <dc:creator>zegab</dc:creator>
      <dc:date>2024-10-15T13:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395230#M248898</link>
      <description>&lt;P&gt;Yes, if I add just one Key and value into where clause query work correctly and return correct sets of data&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2024 13:29:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395230#M248898</guid>
      <dc:creator>Kjarzyna</dc:creator>
      <dc:date>2024-10-15T13:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395241#M248900</link>
      <description>&lt;P&gt;In your where clause:&lt;/P&gt;&lt;PRE&gt;r.key=’street’ AND r.value=’abc’ AND r.key=’phone’ AND r.value=’123’&lt;/PRE&gt;&lt;P&gt;you are using the "and" operator between all the conditions. That would select a row/record where all of these conditions are true at the same time, but there are no such records. I think that's why you are getting empty results. You should use "OR" between conditions that applies to different rows, like:&lt;/P&gt;&lt;PRE&gt;(r.key=’street’ AND r.value=’abc’) OR (r.key=’phone’ AND r.value=’123’)&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Oct 2024 14:32:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395241#M248900</guid>
      <dc:creator>zegab</dc:creator>
      <dc:date>2024-10-15T14:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395281#M248907</link>
      <description>&lt;P&gt;I wouldn’t like to get records with „or” operator, it will return more records than i really would like to take&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2024 06:09:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/395281#M248907</guid>
      <dc:creator>Kjarzyna</dc:creator>
      <dc:date>2024-10-16T06:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/396992#M249672</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/8448"&gt;@Boris G&lt;/a&gt;&amp;nbsp;it doesn’t help&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 09:43:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/396992#M249672</guid>
      <dc:creator>Kjarzyna</dc:creator>
      <dc:date>2024-11-05T09:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Impala multiple Key values in where clause with complex type map</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/403870#M252218</link>
      <description>&lt;P&gt;Try query below and let us know if it solves the problem and any other issues you are facing related&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;select id, st.value street, ph.value phone
from table, table.result st, table.result ph
where st.key=’street’ and st.value='abc' and ph.key=’phone’ and ph.value='123'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Mar 2025 13:20:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-multiple-Key-values-in-where-clause-with-complex-type/m-p/403870#M252218</guid>
      <dc:creator>Meenambigai</dc:creator>
      <dc:date>2025-03-10T13:20:00Z</dc:date>
    </item>
  </channel>
</rss>

