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


##########
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)) {
+      throw new UDFArgumentTypeException(
+          0,
           "The first argument to STACK() must be a constant integer (got " +
-          args[0].getTypeName() + " instead).");
+              args[0].getTypeName() + " instead).");

Review Comment:
   Modified
   
https://github.com/apache/hive/pull/4938/commits/8b109aa427c65f8443d403f6c3288630a1dfc1ed



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