<?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 hive query to display Week of the timestamp and its start Date and End Date. in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hive-query-to-display-Week-of-the-timestamp-and-its-start/m-p/200445#M68538</link>
    <description>&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Sep 2017 17:20:54 GMT</pubDate>
    <dc:creator>Gayathridevi</dc:creator>
    <dc:date>2017-09-25T17:20:54Z</dc:date>
    <item>
      <title>hive query to display Week of the timestamp and its start Date and End Date.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hive-query-to-display-Week-of-the-timestamp-and-its-start/m-p/200445#M68538</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 17:20:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hive-query-to-display-Week-of-the-timestamp-and-its-start/m-p/200445#M68538</guid>
      <dc:creator>Gayathridevi</dc:creator>
      <dc:date>2017-09-25T17:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: hive query to display Week of the timestamp and its start Date and End Date.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hive-query-to-display-Week-of-the-timestamp-and-its-start/m-p/200446#M68539</link>
      <description>&lt;PRE&gt;select weekofyear(current_timestamp)&lt;/PRE&gt;&lt;P&gt;Above query would give you the week of the timestamp. &lt;/P&gt;&lt;P&gt;To get the first day of the week --&amp;gt;&lt;/P&gt;&lt;PRE&gt;select date_sub(current_timestamp,pmod(datediff(current_timestamp,'1900-01-07'),7));&lt;/PRE&gt;&lt;P&gt;To get last day of the week --&amp;gt;&lt;/P&gt;&lt;PRE&gt;select last_day(current_timestamp);&lt;/PRE&gt;&lt;P&gt;Hope it helps &lt;A rel="user" href="https://community.cloudera.com/users/39249/gayathrimtechcse.html" nodeid="39249"&gt;@Gayathri Devi&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 18:19:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hive-query-to-display-Week-of-the-timestamp-and-its-start/m-p/200446#M68539</guid>
      <dc:creator>balavignesh_nag</dc:creator>
      <dc:date>2017-09-25T18:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: hive query to display Week of the timestamp and its start Date and End Date.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hive-query-to-display-Week-of-the-timestamp-and-its-start/m-p/200447#M68540</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/139250/query-in-hive-to-find-the-hours-from-timestamp-and.html?childToView=138336#"&gt;@Gayathri Devi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I couldn't think of any built in function in hive to handle this scenario. &lt;/P&gt;&lt;P&gt;The other way of doing this is by using something like below:&lt;/P&gt;&lt;PRE&gt;select from_unixtime(unix_timestamp(current_timestamp)+7200);&lt;/PRE&gt;&lt;P&gt;7200 implies seconds needed for 2 hours as mentioned in your quetion. You can alter it based on your need.&lt;/P&gt;&lt;P&gt;Instead of the hardcoded value you can pass variable or row_number()over() * 3600 can be used to generate sequentially.&lt;/P&gt;&lt;P&gt;Hope it Helps!!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 18:04:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hive-query-to-display-Week-of-the-timestamp-and-its-start/m-p/200447#M68540</guid>
      <dc:creator>balavignesh_nag</dc:creator>
      <dc:date>2017-09-26T18:04:24Z</dc:date>
    </item>
  </channel>
</rss>

