okumin commented on code in PR #4938:
URL: https://github.com/apache/hive/pull/4938#discussion_r1489161919


##########
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFStack.java:
##########
@@ -63,13 +64,21 @@ public StructObjectInspector initialize(ObjectInspector[] 
args)
     }
     if (!(args[0] instanceof ConstantObjectInspector)) {
       throw new UDFArgumentException(
+          "The first argument to STACK() must be a constant.");
+    }
+    final Object value = ((ConstantObjectInspector) 
args[0]).getWritableConstantValue();
+    if (value == null) {
+      throw new UDFArgumentException("The first argument of STACK() must not 
be null.");
+    }
+    if (!(value instanceof IntWritable)) {

Review Comment:
   Yes, but I believe there is no valid use case for two reasons.
   - This UDF can't process N > Integer.MAX_VALUE anyway, as the maximum length 
of Java's arrays is Integer.MAX_VALUE
   - I don't think anyone prefers to write `stack(cast(3 as bigint), a, b, c, 
...`



-- 
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]

Reply via email to