<?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: hive join tables and extracts value based on column values in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/hive-join-tables-and-extracts-value-based-on-column-values/m-p/196805#M158858</link>
    <description>&lt;P&gt;Please try the below query, it should return required results&lt;/P&gt;&lt;PRE&gt;select text from t1 join match where instr(text, hint) !=0;&lt;/PRE&gt;&lt;P&gt;If my suggestion helped to solve the problem, accept the answer. It might help others in the community.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Oct 2018 21:59:40 GMT</pubDate>
    <dc:creator>nramanaiah</dc:creator>
    <dc:date>2018-10-05T21:59:40Z</dc:date>
    <item>
      <title>hive join tables and extracts value based on column values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-join-tables-and-extracts-value-based-on-column-values/m-p/196804#M158857</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I need help to get the below result.&lt;/P&gt;&lt;P&gt;I have two tables&lt;/P&gt;&lt;PRE&gt;table name: match
+-----------------------------------+----------------+--+
|            hint                   | remarks        |
+-----------------------------------+----------------+--+
| 1.1.1.1                           | ip             |
| 123456789                         | contact        |
| &lt;A href="http://123123123123123123.some_n" target="_blank"&gt;http://123123123123123123.some_n&lt;/A&gt;  | url            |
+-----------------------------------+----------------+--+
&lt;/PRE&gt;&lt;PRE&gt;table name : t1

+-------------------------------------------------------------------------------+-------------------+--+
|                                     t1.text                                   |       t1.b        |
+-------------------------------------------------------------------------------+-------------------+--+
| This ip is found 1.1.1.1 and is matched with match                            | table name match  |
| This ip is found 1.1.1.2 and is matched with match                            | table name match  |
| This contact is found 123456789 and is matched with match                     | table name match  |
| This contact is found 123456789123456789 and is matched with match            | table name match  |
| This url is found &lt;A href="http://123456789123456789.some_n" target="_blank"&gt;http://123456789123456789.some_n&lt;/A&gt; and is matched with match  | table name match  |
+-------------------------------------------------------------------------------+-------------------+--+


&lt;/PRE&gt;&lt;P&gt;I want to search hint column of match table in text column of t1 table  and get complete text column values.&lt;/P&gt;&lt;P&gt;so, basically I want to do a query like&lt;/P&gt;&lt;P&gt;select t1.text from t1 join match where t1.text contains (any value in match.hint);&lt;/P&gt;&lt;P&gt;It will be helpful if this can be done in hive or I can live with pyspark, so pyspark help is also welcome&lt;/P&gt;&lt;P&gt;P.S: table t1 is a big table and match is a small table with limite values(say 1500).&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 20:14:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-join-tables-and-extracts-value-based-on-column-values/m-p/196804#M158857</guid>
      <dc:creator>mark_hadoop</dc:creator>
      <dc:date>2018-10-01T20:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: hive join tables and extracts value based on column values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/hive-join-tables-and-extracts-value-based-on-column-values/m-p/196805#M158858</link>
      <description>&lt;P&gt;Please try the below query, it should return required results&lt;/P&gt;&lt;PRE&gt;select text from t1 join match where instr(text, hint) !=0;&lt;/PRE&gt;&lt;P&gt;If my suggestion helped to solve the problem, accept the answer. It might help others in the community.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 21:59:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/hive-join-tables-and-extracts-value-based-on-column-values/m-p/196805#M158858</guid>
      <dc:creator>nramanaiah</dc:creator>
      <dc:date>2018-10-05T21:59:40Z</dc:date>
    </item>
  </channel>
</rss>

