Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 2.1
-
None
Description
The precondition below fails if a Hive udf uses a String as an argument type.
/** * evaluate function called by the backend. The inputs to the UDF have * been serialized to 'input' */ public void evaluate() throws ImpalaRuntimeException { try { for (int i = 0; i < argTypes_.length; ++i) { if (UnsafeUtil.UNSAFE.getByte(inputNullsPtr_ + i) == 0) { if (isArgString_[i]) { Preconditions.checkState(inputArgs_[i] instanceof ImpalaBytesWritable);
the value in inputArgs_ that should be a string is null.
This came up while adding tests in tests/test-hive-udfs/src/main/java/com/cloudera/impala/TestUdf.java for IMPALA-1134. If something like
public String evaluate(String a, String b, String c) { if (a == null || b == null || c == null) return null; return a + b + c; }
is added, impalad crashes during execution.