<?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: Impala date in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Impala-date/m-p/89404#M12011</link>
    <description>Hi,&lt;BR /&gt;the unix_timestamp function return a number of seconds but it seems that ipid.bk_eff_strt_dt column is inserted with the milliseconds number!?&lt;BR /&gt;About your query try this:&lt;BR /&gt;&lt;BR /&gt;SELECT COUNT(*)&lt;BR /&gt;FROM ipid&lt;BR /&gt;WHERE unix_timestamp('20190124',"yyyyMMdd")*1000 BETWEEN ipid.BK_EFF_STRT_DT AND ipid.BK_EFF_END_DT;&lt;BR /&gt;&lt;BR /&gt;Good luck.</description>
    <pubDate>Mon, 22 Apr 2019 22:13:02 GMT</pubDate>
    <dc:creator>AcharkiMed</dc:creator>
    <dc:date>2019-04-22T22:13:02Z</dc:date>
    <item>
      <title>Impala date</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-date/m-p/89395#M12010</link>
      <description>&lt;P&gt;When i am running below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select unix_timestamp('20190131 05:00:00',"yyyyMMdd HH:mm:ss");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output is&amp;nbsp;1548910800&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when i am running same thing on a table on a column which is big int&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select min(IPID.BK_EFF_STRT_DT) ,max(IPID.BK_EFF_STRT_DT) from&amp;nbsp; ipid;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;o/p is below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;+--------------------------+--------------------------+&lt;BR /&gt;| min(ipid.bk_eff_strt_dt) | max(ipid.bk_eff_strt_dt) |&lt;BR /&gt;+--------------------------+--------------------------+&lt;BR /&gt;| 1512709200000 | 1548910800000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why is extra 0 added in 2nd case&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select cast(1548910800000 div 1000 as timestamp) + interval (1548910800000 % 1000) milliseconds;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;returns :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2019-01-31 05:00:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is causing issue when i am trying something like below it returns 0 rows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select count(*) from ipid&lt;BR /&gt;where unix_timestamp('20190124',"yyyyMMdd") between IPID.BK_EFF_STRT_DT AND IPID.BK_EFF_END_DT;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 14:19:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-date/m-p/89395#M12010</guid>
      <dc:creator>Learner_new</dc:creator>
      <dc:date>2022-09-16T14:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Impala date</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-date/m-p/89404#M12011</link>
      <description>Hi,&lt;BR /&gt;the unix_timestamp function return a number of seconds but it seems that ipid.bk_eff_strt_dt column is inserted with the milliseconds number!?&lt;BR /&gt;About your query try this:&lt;BR /&gt;&lt;BR /&gt;SELECT COUNT(*)&lt;BR /&gt;FROM ipid&lt;BR /&gt;WHERE unix_timestamp('20190124',"yyyyMMdd")*1000 BETWEEN ipid.BK_EFF_STRT_DT AND ipid.BK_EFF_END_DT;&lt;BR /&gt;&lt;BR /&gt;Good luck.</description>
      <pubDate>Mon, 22 Apr 2019 22:13:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-date/m-p/89404#M12011</guid>
      <dc:creator>AcharkiMed</dc:creator>
      <dc:date>2019-04-22T22:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Impala date</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Impala-date/m-p/89408#M12013</link>
      <description>Thanks&lt;BR /&gt;Will try that,do you have any suggestion on best way to implementing&lt;BR /&gt;dimension with scd2 type in hadoop, our dimension table has several sources&lt;BR /&gt;and all should be able to load /update concurrently in dimension table.&lt;BR /&gt;#- Please type your reply above this line -##</description>
      <pubDate>Mon, 22 Apr 2019 23:07:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Impala-date/m-p/89408#M12013</guid>
      <dc:creator>Learner_new</dc:creator>
      <dc:date>2019-04-22T23:07:44Z</dc:date>
    </item>
  </channel>
</rss>

