Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-12258

Hive Timestamp UDF is binded with '1969-12-31 15:59:59.999999' for null value

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.0
    • Fix Version/s: 1.6.0
    • Component/s: SQL
    • Labels:
      None
    • Target Version/s:

      Description

        test("Timestamp UDF and Null value") {
          hiveContext.runSqlHive("CREATE TABLE ts_test (ts TIMESTAMP) STORED AS TEXTFILE")
          hiveContext.runSqlHive("INSERT INTO TABLE ts_test VALUES(Null)")
          hiveContext.udf.register("dummy",
            (ts: Timestamp) => ts
          )
          val result = hiveContext.sql("SELECT dummy(ts) FROM ts_test").collect().mkString("\n")
          assertResult("[null]")(result)
        }
      

        Attachments

          Activity

            People

            • Assignee:
              davies Davies Liu
              Reporter:
              ianlcsd Ian
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: