okumin commented on code in PR #4938:
URL: https://github.com/apache/hive/pull/4938#discussion_r1423354230
##########
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDTFStack.java:
##########
@@ -63,11 +64,16 @@ 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 instanceof IntWritable)) {
Review Comment:
I added a validation since the current implementation throws a
ClassCastException. I can split PRs if we don't want to fix it in this PR.
--
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]