<?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: CASE statement Error in Beeline HIVE in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194108#M68649</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/39249/gayathrimtechcse.html" nodeid="39249"&gt;@Gayathri Devi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;sample nested case which can be used in hive.&lt;/P&gt;&lt;PRE&gt;Select case 
when hour(split(split(hbid,"#")[1],"_")[1])== 0 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","0-2") 
when hour(split(split(hbid,"#")[1],"_")[1]) ==1 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","0-2")]
when hour(split(split(hbid,"#")[1],"_")[1]) ==2 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","2-4")]
when hour(split(split(hbid,"#")[1],"_")[1]) ==2 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","2-4")]
when hour(split(split(hbid,"#")[1],"_")[1]) ==3 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","2-4")]
else 'NA'
end as column1 from table_name; &lt;/PRE&gt;&lt;P&gt;If it helps then please accept it as the best answer! Happy Hadooping!!&lt;/P&gt;</description>
    <pubDate>Thu, 28 Sep 2017 16:25:09 GMT</pubDate>
    <dc:creator>balavignesh_nag</dc:creator>
    <dc:date>2017-09-28T16:25:09Z</dc:date>
    <item>
      <title>CASE statement Error in Beeline HIVE</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194106#M68647</link>
      <description />
      <pubDate>Wed, 27 Sep 2017 17:36:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194106#M68647</guid>
      <dc:creator>Gayathridevi</dc:creator>
      <dc:date>2017-09-27T17:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: CASE statement Error in Beeline HIVE</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194107#M68648</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/39249/gayathrimtechcse.html" nodeid="39249"&gt;@Gayathri Devi&lt;/A&gt; &lt;/P&gt;&lt;P&gt;You have missed &lt;STRONG&gt;end &lt;/STRONG&gt;in the statement. This should work.&lt;/P&gt;&lt;PRE&gt;case when hour(split(split(hbid,"#")[1],"_")[1])==0&amp;lt;br&amp;gt;then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","0-2") else 'NA' end&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 19:53:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194107#M68648</guid>
      <dc:creator>balavignesh_nag</dc:creator>
      <dc:date>2017-09-27T19:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: CASE statement Error in Beeline HIVE</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194108#M68649</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/39249/gayathrimtechcse.html" nodeid="39249"&gt;@Gayathri Devi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;sample nested case which can be used in hive.&lt;/P&gt;&lt;PRE&gt;Select case 
when hour(split(split(hbid,"#")[1],"_")[1])== 0 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","0-2") 
when hour(split(split(hbid,"#")[1],"_")[1]) ==1 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","0-2")]
when hour(split(split(hbid,"#")[1],"_")[1]) ==2 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","2-4")]
when hour(split(split(hbid,"#")[1],"_")[1]) ==2 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","2-4")]
when hour(split(split(hbid,"#")[1],"_")[1]) ==3 then concat(split(split(split(hbid,"#")[1],"_")[1]," ")[0],"/","2-4")]
else 'NA'
end as column1 from table_name; &lt;/PRE&gt;&lt;P&gt;If it helps then please accept it as the best answer! Happy Hadooping!!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 16:25:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194108#M68649</guid>
      <dc:creator>balavignesh_nag</dc:creator>
      <dc:date>2017-09-28T16:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: CASE statement Error in Beeline HIVE</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194109#M68650</link>
      <description>&lt;P&gt;Will Try and let u know. thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 16:28:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/CASE-statement-Error-in-Beeline-HIVE/m-p/194109#M68650</guid>
      <dc:creator>Gayathridevi</dc:creator>
      <dc:date>2017-09-28T16:28:53Z</dc:date>
    </item>
  </channel>
</rss>

