Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-5237

from_unixtime cannot include literal H - incompatible with hive

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Backend
    • Labels:
    • Environment:
      Impala Shell v2.6.0-cdh5.8.3 (9872875) built on Fri Dec 9 14:31:00 PST 2016
    • Epic Color:
      ghx-label-3

      Description

      I need to format a date as 2017-04-20H18. No amount of backslashes or ticks will get this done.

      In hive, it looks like:

      hive> select from_unixtime(1492677561,'yyyy-MM-dd\'H\'HH');
      OK
      _c0
      2017-04-20H08
      

      In impala, the same query returns the wrong thing. Instead of a literal H, it gives me '8' (because the hour happens to be 8).

      [atl1c1mgr-vip.vldb-bo.secureworks.net:21001] > select from_unixtime(1492677561,'yyyy-MM-dd\'H\'HH');
      Query: select from_unixtime(1492677561,'yyyy-MM-dd\'H\'HH')
      +------------------------------------------------+
      | from_unixtime(1492677561, 'yyyy-mm-dd\'h\'hh') |
      +------------------------------------------------+
      | 2017-04-20'8'08                                |
      +------------------------------------------------+
      Fetched 1 row(s) in 0.05s
      

      from_unixtime should support literals. My preference would be that it uses the same syntax as hive to achieve this.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jinchul Jinchul Kim
                Reporter:
                loubershad Lou Bershad
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: