zabetak commented on a change in pull request #2816:
URL: https://github.com/apache/hive/pull/2816#discussion_r759283876
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFNullif.java
##########
@@ -49,6 +50,17 @@ public ObjectInspector initialize(ObjectInspector[]
arguments) throws UDFArgumen
returnOIResolver = new GenericUDFUtils.ReturnObjectInspectorResolver(true);
returnOIResolver.update(arguments[0]);
+ switch (arguments[0].getCategory()) {
+ case LIST:
+ case MAP:
+ case STRUCT:
+ case PRIMITIVE:
+ break;
+ case UNION:
+ default:
+ throw new UDFArgumentTypeException(0, "Unsupported Argument type
category: " + arguments[0].getCategory());
+ }
+
boolean isPrimitive = (arguments[0] instanceof PrimitiveObjectInspector);
if (isPrimitive)
{
Review comment:
From reading the code, it seems that we cannot do `NULLIF(1,'1')` it
will fail with an exception. On the contrary it seems that now, we are able to
do `NULLIF(array(1,2), array('1','2'))`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]