Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-18863

trunc() calls itself trunk() in an error message

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0, 2.4.0
    • Component/s: UDF
    • Labels:

      Description

      > select  trunc('millennium', cast('2001-02-16 20:38:40' as timestamp))
      FAILED: SemanticException Line 0:-1 Argument type mismatch ''2001-02-16 20:38:40'': trunk() only takes STRING/CHAR/VARCHAR types as second argument, got TIMESTAMP
      

      I saw this on a derivative of Hive 1.1.0 (cdh5.15.0), but the string still seems to be present on master:
      https://github.com/apache/hive/blob/6d890faf22fd1ede3658a5eed097476eab3c67e9/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFTrunc.java#L262

        Attachments

        1. HIVE-18863.2.patch
          1 kB
          Bharathkrishna Guruvayoor Murali
        2. HIVE-18863.1.patch
          1 kB
          Bharathkrishna Guruvayoor Murali

          Activity

            People

            • Assignee:
              bharos92 Bharathkrishna Guruvayoor Murali
              Reporter:
              tarmstrong Tim Armstrong
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: