Details
-
Bug
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
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:
if val1i > val2i then print('val1 greater'); end if;
And either val1 or val2 is null, you will get an exception similar to the following:
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)