hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashutosh Chauhan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-6645) to_date()/to_unix_timestamp() fail with NPE if input is null
Date Thu, 20 Mar 2014 01:42:43 GMT

     [ https://issues.apache.org/jira/browse/HIVE-6645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ashutosh Chauhan updated HIVE-6645:
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.13.0
           Status: Resolved  (was: Patch Available)

Committed to trunk & 0.13. Thanks, Jason!

> to_date()/to_unix_timestamp() fail with NPE if input is null
> ------------------------------------------------------------
>
>                 Key: HIVE-6645
>                 URL: https://issues.apache.org/jira/browse/HIVE-6645
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>            Reporter: Jason Dere
>            Assignee: Jason Dere
>             Fix For: 0.13.0
>
>         Attachments: HIVE-6645.1.patch, HIVE-6645.2.patch, HIVE-6645.2.patch
>
>
> {noformat}
> hive> describe tab2;
> Query ID = jdere_20140312185454_e3ed213e-8b3a-4963-b815-19965edad587
> OK
> c1                  	timestamp           	None                
> Time taken: 0.155 seconds, Fetched: 1 row(s)
> hive> select * from tab2;
> Query ID = jdere_20140312185454_8a009070-df79-45de-8642-e85668a378d7
> OK
> NULL
> NULL
> NULL
> NULL
> NULL
> Time taken: 0.067 seconds, Fetched: 5 row(s)
> hive> select to_unix_timestamp(c1) from tab2;           
> hive> select to_date(c1) from tab2;          
> {noformat}
> Fails with errors like:
> {noformat}
> java.lang.Exception: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException:
Hive Runtime Error while processing row {"c1":null}
>         at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:401)
> Caused by: java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException:
Hive Runtime Error while processing row {"c1":null}
>         at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.map(ExecMapper.java:195)
>         at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:54)
>         at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:429)
>         at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
>         at org.apache.hadoop.mapred.LocalJobRunner$Job$MapTaskRunnable.run(LocalJobRunner.java:233)
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
>         at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>         at java.lang.Thread.run(Thread.java:680)
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Hive Runtime Error while
processing row {"c1":null}
>         at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:534)
>         at org.apache.hadoop.hive.ql.exec.mr.ExecMapper.map(ExecMapper.java:177)
>         ... 10 more
> Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: Error evaluating to_date(c1)
>         at org.apache.hadoop.hive.ql.exec.SelectOperator.processOp(SelectOperator.java:84)
>         at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:790)
>         at org.apache.hadoop.hive.ql.exec.TableScanOperator.processOp(TableScanOperator.java:92)
>         at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:790)
>         at org.apache.hadoop.hive.ql.exec.MapOperator.process(MapOperator.java:524)
>         ... 11 more
> Caused by: java.lang.NullPointerException
>         at org.apache.hadoop.hive.ql.udf.generic.GenericUDFDate.evaluate(GenericUDFDate.java:106)
>         at org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator._evaluate(ExprNodeGenericFuncEvaluator.java:166)
>         at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:77)
>         at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:65)
>         at org.apache.hadoop.hive.ql.exec.SelectOperator.processOp(SelectOperator.java:79)
>         ... 15 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message