hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Tolpeko (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-17029) HPL/SQL: Comparison if not null-safe
Date Wed, 06 Sep 2017 15:06:00 GMT

    [ https://issues.apache.org/jira/browse/HIVE-17029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16155497#comment-16155497
] 

Dmitry Tolpeko commented on HIVE-17029:
---------------------------------------

just for reference, in SQL Server: IF NULL > NULL executes ELSE block. 

> HPL/SQL: Comparison if not null-safe
> ------------------------------------
>
>                 Key: HIVE-17029
>                 URL: https://issues.apache.org/jira/browse/HIVE-17029
>             Project: Hive
>          Issue Type: Bug
>          Components: hpl/sql
>            Reporter: Carter Shanklin
>            Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered writing
a reporting script that would aggregate values and give rows different classifications based
on an the aggregate. Addressing some or all of these issues would make HPL/SQL more accessible
to newcomers.
> If you run a statement like:
> {code}
>   if val1i > val2i then
>     print('val1 greater');
>   end if;
> {code}
> And either val1 or val2 is null, you will get an exception similar to the following:
> {code}
> Unhandled exception in HPL/SQL
> java.lang.NullPointerException
>         at org.apache.hive.hplsql.Var.compareTo(Var.java:453)
>         at org.apache.hive.hplsql.Expression.operatorCompare(Expression.java:454)
>         at org.apache.hive.hplsql.Expression.execBoolBinary(Expression.java:178)
>         at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:1589)
>         at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:52)
>         at org.apache.hive.hplsql.HplsqlParser$Bool_expr_binaryContext.accept(HplsqlParser.java:19397)
>         at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>         at org.apache.hive.hplsql.HplsqlBaseVisitor.visitBool_expr_atom(HplsqlBaseVisitor.java:1316)
>         at org.apache.hive.hplsql.HplsqlParser$Bool_expr_atomContext.accept(HplsqlParser.java:18985)
>         at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
>         at org.apache.hive.hplsql.Expression.visit(Expression.java:660)
>         at org.apache.hive.hplsql.Expression.eval(Expression.java:624)
>         at org.apache.hive.hplsql.Expression.execBool(Expression.java:121)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message