<?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: how do I get all the variable names in a string before an operator in Hive in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/how-do-I-get-all-the-variable-names-in-a-string-before-an/m-p/387491#M246330</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/110393"&gt;@VTHive&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming you have a table named your_table with a column named condition,&amp;nbsp; you can extract the variable names using SQL:&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;SUBSTRING_INDEX(SUBSTRING_INDEX(condition, '=', 1), ' ', -1) AS variable_name&lt;BR /&gt;FROM&lt;BR /&gt;your_table&lt;BR /&gt;UNION&lt;BR /&gt;SELECT&lt;BR /&gt;SUBSTRING_INDEX(SUBSTRING_INDEX(condition, ' in ', 1), ' ', -1) AS variable_name&lt;BR /&gt;FROM&lt;BR /&gt;your_table&lt;BR /&gt;WHERE&lt;BR /&gt;condition LIKE '% in %'&lt;BR /&gt;UNION&lt;BR /&gt;SELECT&lt;BR /&gt;TRIM(SUBSTRING_INDEX(SUBSTRING_INDEX(condition, '=', 1), ' ', -1)) AS variable_name&lt;BR /&gt;FROM&lt;BR /&gt;your_table&lt;BR /&gt;WHERE&lt;BR /&gt;condition LIKE '% ne %';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The query will extract the variable names from the conditions in the condition column of your table. It handles conditions with =, in, and ne operators. Adjust the table and column names accordingly to fit your actual schema&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2024 05:18:30 GMT</pubDate>
    <dc:creator>RAGHUY</dc:creator>
    <dc:date>2024-05-02T05:18:30Z</dc:date>
    <item>
      <title>how do I get all the variable names in a string before an operator in Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-do-I-get-all-the-variable-names-in-a-string-before-an/m-p/387488#M246328</link>
      <description>&lt;P&gt;Hi I have a table where I have multiple conditions using operators or conditions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;so, for each of the rows I need to get the variable name which has _&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE width="754px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="754px"&gt;CONS_GRP = 'CCA'&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="754px"&gt;HL_GROUP_IN in ('1_HNO', '2_HO_W') and trim(PROD_SEG_MODL_DE) = 'VASO'&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="754px"&gt;&lt;P&gt;CONS_SVC_GRP = 'CCA' and olb_cust ne 'A'&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;output:&lt;/P&gt;&lt;P&gt;for row1:&amp;nbsp; &amp;nbsp;Cons_grp&lt;/P&gt;&lt;P&gt;for row2:&amp;nbsp;HL_GROUP_IN&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROD_SEG_MODL_DE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for row3:&amp;nbsp;CONS_SVC_GRP&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;olb_cust&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am okay if the output is in a row or column. appreciate any help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 17:25:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-do-I-get-all-the-variable-names-in-a-string-before-an/m-p/387488#M246328</guid>
      <dc:creator>VTHive</dc:creator>
      <dc:date>2024-05-01T17:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: how do I get all the variable names in a string before an operator in Hive</title>
      <link>https://community.cloudera.com/t5/Support-Questions/how-do-I-get-all-the-variable-names-in-a-string-before-an/m-p/387491#M246330</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/110393"&gt;@VTHive&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assuming you have a table named your_table with a column named condition,&amp;nbsp; you can extract the variable names using SQL:&lt;/P&gt;&lt;P&gt;SELECT&lt;BR /&gt;SUBSTRING_INDEX(SUBSTRING_INDEX(condition, '=', 1), ' ', -1) AS variable_name&lt;BR /&gt;FROM&lt;BR /&gt;your_table&lt;BR /&gt;UNION&lt;BR /&gt;SELECT&lt;BR /&gt;SUBSTRING_INDEX(SUBSTRING_INDEX(condition, ' in ', 1), ' ', -1) AS variable_name&lt;BR /&gt;FROM&lt;BR /&gt;your_table&lt;BR /&gt;WHERE&lt;BR /&gt;condition LIKE '% in %'&lt;BR /&gt;UNION&lt;BR /&gt;SELECT&lt;BR /&gt;TRIM(SUBSTRING_INDEX(SUBSTRING_INDEX(condition, '=', 1), ' ', -1)) AS variable_name&lt;BR /&gt;FROM&lt;BR /&gt;your_table&lt;BR /&gt;WHERE&lt;BR /&gt;condition LIKE '% ne %';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The query will extract the variable names from the conditions in the condition column of your table. It handles conditions with =, in, and ne operators. Adjust the table and column names accordingly to fit your actual schema&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 05:18:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/how-do-I-get-all-the-variable-names-in-a-string-before-an/m-p/387491#M246330</guid>
      <dc:creator>RAGHUY</dc:creator>
      <dc:date>2024-05-02T05:18:30Z</dc:date>
    </item>
  </channel>
</rss>

