hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xuefu Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-5656) Hive produces unclear, confusing SemanticException when dealing with mod or pmod by zero
Date Sun, 27 Oct 2013 04:45:31 GMT

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

Xuefu Zhang updated HIVE-5656:
------------------------------

    Status: Patch Available  (was: Open)

> Hive produces unclear, confusing SemanticException when dealing with mod or pmod by zero
> ----------------------------------------------------------------------------------------
>
>                 Key: HIVE-5656
>                 URL: https://issues.apache.org/jira/browse/HIVE-5656
>             Project: Hive
>          Issue Type: Bug
>          Components: Types
>    Affects Versions: 0.12.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
>         Attachments: HIVE-5656.patch
>
>
> {code}
> hive> select 5%0 from tmp2 limit 1;
> FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments '0': org.apache.hadoop.hive.ql.metadata.HiveException:
Unable to execute method public org.apache.hadoop.io.IntWritable org.apache.hadoop.hive.ql.udf.UDFOPMod.evaluate(org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable)
 on object org.apache.hadoop.hive.ql.udf.UDFOPMod@21b594a9 of class org.apache.hadoop.hive.ql.udf.UDFOPMod
with arguments {5:org.apache.hadoop.io.IntWritable, 0:org.apache.hadoop.io.IntWritable} of
size 2
> hive> select pmod(5,0) from tmp2 limit 1;
> FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments '0': org.apache.hadoop.hive.ql.metadata.HiveException:
Unable to execute method public org.apache.hadoop.io.IntWritable org.apache.hadoop.hive.ql.udf.UDFPosMod.evaluate(org.apache.hadoop.io.IntWritable,org.apache.hadoop.io.IntWritable)
 on object org.apache.hadoop.hive.ql.udf.UDFPosMod@174ed99a of class org.apache.hadoop.hive.ql.udf.UDFPosMod
with arguments {5:org.apache.hadoop.io.IntWritable, 0:org.apache.hadoop.io.IntWritable} of
size 2
> {code}
> Exception stack:
> {code}
>         at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory$DefaultExprProcessor.process(TypeCheckProcFactory.java:1112)
>         at org.apache.hadoop.hive.ql.lib.DefaultRuleDispatcher.dispatch(DefaultRuleDispatcher.java:90)
>         at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatchAndReturn(DefaultGraphWalker.java:94)
>         at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.dispatch(DefaultGraphWalker.java:78)
>         at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.walk(DefaultGraphWalker.java:132)
>         at org.apache.hadoop.hive.ql.lib.DefaultGraphWalker.startWalking(DefaultGraphWalker.java:109)
>         at org.apache.hadoop.hive.ql.parse.TypeCheckProcFactory.genExprNode(TypeCheckProcFactory.java:181)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genAllExprNodeDesc(SemanticAnalyzer.java:8870)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genExprNodeDesc(SemanticAnalyzer.java:8826)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genSelectPlan(SemanticAnalyzer.java:2734)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genSelectPlan(SemanticAnalyzer.java:2531)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPostGroupByBodyPlan(SemanticAnalyzer.java:7606)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genBodyPlan(SemanticAnalyzer.java:7562)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genPlan(SemanticAnalyzer.java:8365)
>         at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:8591)
>         at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:284)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:451)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:351)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1004)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:915)
>         at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220)
>         at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:422)
>         at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:790)
>         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:684)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:623)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> {code}
> The correct behaviour should be producing NULL.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message