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

from_unixtime does not support BIGINT

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 1.0.1
    • Impala 1.1.1, Impala 1.2
    • None

    Description

      Impala report error when passing BIGINT to from_unixtime() which conflict with its document.

      1. explicite test.
        $ impala-shell -q "select from_unixtime(cast(0 as bigint))"
        Connected to cnbladel1n01.clusters.com:21000
        Server version: impalad version 1.0.1 RELEASE (build df844fb967cec8740f08dfb8b21962bc053527ef)
        Query: select from_unixtime(cast(0 as bigint))
        ERROR: AnalysisException: No matching function with those arguments: from_unixtime (BIGINT)
        Could not execute command: select from_unixtime(cast(0 as bigint))
      1. implicit test
        $ impala-shell -q "select from_unixtime(`date -u -d "2038-01-19" "+%s"`);"
        Connected to cnbladel1n01.clusters.com:21000
        Server version: impalad version 1.0.1 RELEASE (build df844fb967cec8740f08dfb8b21962bc053527ef)
        Query: select from_unixtime(2147472000)
        Query finished, fetching results ...
        ---------------------------
        from_unixtime(2147472000)

        ---------------------------

        2038-01-19 00:00:00

        ---------------------------
        Returned 1 row(s) in 0.26s

      $ impala-shell -q "select from_unixtime(`date -u -d "2038-01-20" "+%s"`);"
      Connected to cnbladel1n01.clusters.com:21000
      Server version: impalad version 1.0.1 RELEASE (build df844fb967cec8740f08dfb8b21962bc053527ef)
      Query: select from_unixtime(2147558400)
      ERROR: AnalysisException: No matching function with those arguments: from_unixtime (BIGINT)
      Could not execute command: select from_unixtime(2147558400)

      1. Hive works for all above test cases.
        $ hive -e "select from_unixtime(cast(0 as bigint)) from tab1 limit 1;"
        Logging initialized using configuration in jar:file:/usr/lib/hive/lib/hive-common-0.10.0-cdh4.3.0.jar!/hive-log4j.properties
        Hive history file=/tmp/fuzhiwen/hive_job_log_c1dd5b11-4a0e-4be9-9524-e5821b5a8123_1639546170.txt
        Total MapReduce jobs = 1
        Launching Job 1 out of 1
        Number of reduce tasks is set to 0 since there's no reduce operator
        Starting Job = job_201306080735_0047, Tracking URL = http://cnbladel1n02.clusters.com:50030/jobdetails.jsp?jobid=job_201306080735_0047
        Kill Command = /usr/lib/hadoop/bin/hadoop job -kill job_201306080735_0047
        Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
        2013-06-20 16:35:07,546 Stage-1 map = 0%, reduce = 0%
        2013-06-20 16:35:13,600 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.9 sec
        2013-06-20 16:35:14,624 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.9 sec
        2013-06-20 16:35:15,636 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.9 sec
        2013-06-20 16:35:16,647 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 1.9 sec
        MapReduce Total cumulative CPU time: 1 seconds 900 msec
        Ended Job = job_201306080735_0047
        MapReduce Jobs Launched:
        Job 0: Map: 1 Cumulative CPU: 1.9 sec HDFS Read: 374 HDFS Write: 20 SUCCESS
        Total MapReduce CPU Time Spent: 1 seconds 900 msec
        OK
        1970-01-01 08:00:00
        Time taken: 20.576 seconds

      $ hive -e "select from_unixtime(`date -u -d "2038-01-20" "+%s"`) from tab1 limit 1;"
      Logging initialized using configuration in jar:file:/usr/lib/hive/lib/hive-common-0.10.0-cdh4.3.0.jar!/hive-log4j.properties
      Hive history file=/tmp/fuzhiwen/hive_job_log_26673a46-3a87-4013-8e23-2b2848750077_189113069.txt
      Total MapReduce jobs = 1
      Launching Job 1 out of 1
      Number of reduce tasks is set to 0 since there's no reduce operator
      Starting Job = job_201306080735_0048, Tracking URL = http://cnbladel1n02.clusters.com:50030/jobdetails.jsp?jobid=job_201306080735_0048
      Kill Command = /usr/lib/hadoop/bin/hadoop job -kill job_201306080735_0048
      Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 0
      2013-06-20 16:36:04,710 Stage-1 map = 0%, reduce = 0%
      2013-06-20 16:36:11,773 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.84 sec
      2013-06-20 16:36:12,792 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.84 sec
      2013-06-20 16:36:13,804 Stage-1 map = 100%, reduce = 0%, Cumulative CPU 1.84 sec
      2013-06-20 16:36:14,816 Stage-1 map = 100%, reduce = 100%, Cumulative CPU 1.84 sec
      MapReduce Total cumulative CPU time: 1 seconds 840 msec
      Ended Job = job_201306080735_0048
      MapReduce Jobs Launched:
      Job 0: Map: 1 Cumulative CPU: 1.84 sec HDFS Read: 374 HDFS Write: 20 SUCCESS
      Total MapReduce CPU Time Spent: 1 seconds 840 msec
      OK
      2038-01-20 08:00:00
      Time taken: 20.417 seconds

      Attachments

        Activity

          People

            alex.behm Alexander Behm
            dillonfzw_impala_aa74 Zhiwen Fu
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: