diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/NumericOpMethodResolver.java ql/src/java/org/apache/hadoop/hive/ql/exec/NumericOpMethodResolver.java index 43984af..48dd7fd 100644 --- ql/src/java/org/apache/hadoop/hive/ql/exec/NumericOpMethodResolver.java +++ ql/src/java/org/apache/hadoop/hive/ql/exec/NumericOpMethodResolver.java @@ -138,6 +138,11 @@ public Method getEvalMethod(List argTypeInfos) throws UDFArgumentExcep } } } + + if (udfMethod == null) { + throw new NoMatchingMethodException(udfClass, argTypeInfos, null); + } + return udfMethod; } } diff --git ql/src/test/queries/clientnegative/invalid_arithmetic_type.q ql/src/test/queries/clientnegative/invalid_arithmetic_type.q new file mode 100644 index 0000000..ad37cff --- /dev/null +++ ql/src/test/queries/clientnegative/invalid_arithmetic_type.q @@ -0,0 +1,3 @@ + +select timestamp('2001-01-01 00:00:01') - timestamp('2000-01-01 00:00:01') from src; + diff --git ql/src/test/results/clientnegative/invalid_arithmetic_type.q.out ql/src/test/results/clientnegative/invalid_arithmetic_type.q.out new file mode 100644 index 0000000..c4e93ac --- /dev/null +++ ql/src/test/results/clientnegative/invalid_arithmetic_type.q.out @@ -0,0 +1 @@ +FAILED: SemanticException Line 0:-1 Wrong arguments ''2000-01-01 00:00:01'': No matching method for class org.apache.hadoop.hive.ql.udf.UDFOPMinus with (timestamp, timestamp)