<?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 How to set variable in hive partition ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-set-variable-in-hive-partition/m-p/179146#M64774</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;How to set variable in hive and insert value as partition? I have below commands and the partition is not getting from the variable that I set but getting constant "var" instead datetime.&lt;/P&gt;&lt;P&gt;set hiveVar:var= from_unixtime(unix_timestamp()-1*60*60*4, 'yyyyMMddHH');&lt;/P&gt;&lt;P&gt;
INSERT INTO TABLE tmp Partition (datehour='${hiveVar:var}') SELECT * FROM tmp2;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JN&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2017 00:43:27 GMT</pubDate>
    <dc:creator>jeanette75007</dc:creator>
    <dc:date>2017-07-13T00:43:27Z</dc:date>
    <item>
      <title>How to set variable in hive partition ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-set-variable-in-hive-partition/m-p/179146#M64774</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;How to set variable in hive and insert value as partition? I have below commands and the partition is not getting from the variable that I set but getting constant "var" instead datetime.&lt;/P&gt;&lt;P&gt;set hiveVar:var= from_unixtime(unix_timestamp()-1*60*60*4, 'yyyyMMddHH');&lt;/P&gt;&lt;P&gt;
INSERT INTO TABLE tmp Partition (datehour='${hiveVar:var}') SELECT * FROM tmp2;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JN&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 00:43:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-set-variable-in-hive-partition/m-p/179146#M64774</guid>
      <dc:creator>jeanette75007</dc:creator>
      <dc:date>2017-07-13T00:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to set variable in hive partition ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-set-variable-in-hive-partition/m-p/179147#M64775</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/14131/jeanette75007.html" nodeid="14131"&gt;@JT Ng&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Just omit the quotes and fire the insert.&lt;/P&gt;&lt;P&gt;INSERT INTO TABLE tmp Partition (datehour=${hiveVar:var}) SELECT * FROM tmp2;&lt;/P&gt;&lt;P&gt;You can also test before firing the insert like this:&lt;/P&gt;&lt;P&gt;select ${hiveVar:var};&lt;/P&gt;&lt;P&gt;You should be good.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2017 03:17:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-set-variable-in-hive-partition/m-p/179147#M64775</guid>
      <dc:creator>rbiswas1</dc:creator>
      <dc:date>2017-07-13T03:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to set variable in hive partition ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-set-variable-in-hive-partition/m-p/179148#M64776</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14131/jeanette75007.html" nodeid="14131"&gt;@JT Ng&lt;/A&gt; &lt;/P&gt;&lt;P&gt;You might want to close the thread by accepting the answer.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 23:42:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-set-variable-in-hive-partition/m-p/179148#M64776</guid>
      <dc:creator>rbiswas1</dc:creator>
      <dc:date>2017-07-19T23:42:42Z</dc:date>
    </item>
  </channel>
</rss>

