<?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 Impala - Using Time in where clause and time from timestamp in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Using-Time-in-where-clause-and-time-from-timestamp/m-p/83649#M85447</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currenty have a timestamp field converted to a timestamp via&amp;nbsp;cast(a.timefield&amp;nbsp;as timestamp).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to be able to extract the time from the timestamp and then use this in the where clause to filter on results with time between 20:30:00 and 08:00:00.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 13:58:38 GMT</pubDate>
    <dc:creator>Hazard</dc:creator>
    <dc:date>2022-09-16T13:58:38Z</dc:date>
    <item>
      <title>Impala - Using Time in where clause and time from timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Using-Time-in-where-clause-and-time-from-timestamp/m-p/83649#M85447</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currenty have a timestamp field converted to a timestamp via&amp;nbsp;cast(a.timefield&amp;nbsp;as timestamp).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to be able to extract the time from the timestamp and then use this in the where clause to filter on results with time between 20:30:00 and 08:00:00.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;many thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 13:58:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Using-Time-in-where-clause-and-time-from-timestamp/m-p/83649#M85447</guid>
      <dc:creator>Hazard</dc:creator>
      <dc:date>2022-09-16T13:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Impala - Using Time in where clause and time from timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Using-Time-in-where-clause-and-time-from-timestamp/m-p/83712#M85448</link>
      <description>&lt;P&gt;Lets assume your timestamp column is "t", you just calculate the total minutes for the given day from the timestamp and then filter with OR - either it is more than 20*60 +30 (20:30:00) or is less than 8*60 (08:00:00).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;select * from
mytable
where ( date_part('hour', t)* 60 + date_part( 'minute', t) ) &amp;gt;= (20*60+30) or 
( date_part('hour', t)* 60 + date_part( 'minute', t) ) &amp;lt; (8*60)&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Dec 2018 17:01:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Using-Time-in-where-clause-and-time-from-timestamp/m-p/83712#M85448</guid>
      <dc:creator>Tomas79</dc:creator>
      <dc:date>2018-12-11T17:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Impala - Using Time in where clause and time from timestamp</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Using-Time-in-where-clause-and-time-from-timestamp/m-p/83749#M85449</link>
      <description>Tomas that's great. Exactly what I was after. Many thanks.</description>
      <pubDate>Wed, 12 Dec 2018 08:58:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-Using-Time-in-where-clause-and-time-from-timestamp/m-p/83749#M85449</guid>
      <dc:creator>Hazard</dc:creator>
      <dc:date>2018-12-12T08:58:37Z</dc:date>
    </item>
  </channel>
</rss>

