tarak271 commented on code in PR #4090:
URL: https://github.com/apache/hive/pull/4090#discussion_r1226506765
##########
ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArrayExcept.java:
##########
@@ -31,29 +34,47 @@
*/
@Description(name = "array_except", value = "_FUNC_(array1, array2) - Returns
an array of the elements in array1 but not in array2.", extended =
"Example:\n" + " > SELECT _FUNC_(array(1, 2, 3,4), array(2,3)) FROM src
LIMIT 1;\n"
- + " [1,4]") public class GenericUDFArrayExcept extends
AbstractGenericUDFArrayBase {
+ + " [1,4]")
+public class GenericUDFArrayExcept extends AbstractGenericUDFArrayBase {
static final int ARRAY2_IDX = 1;
private static final String FUNC_NAME = "ARRAY_EXCEPT";
+ static final String ERROR_NOT_COMPARABLE = "Input arrays are not comparable
to use ARRAY_EXCEPT udf";
+ private transient ListObjectInspector array2OI;
+ private transient ObjectInspector arrayElementOI;
+ private transient ObjectInspector array2ElementOI;
public GenericUDFArrayExcept() {
super(FUNC_NAME, 2, 2, ObjectInspector.Category.LIST);
}
@Override public ObjectInspector initialize(ObjectInspector[] arguments)
throws UDFArgumentException {
ObjectInspector defaultOI = super.initialize(arguments);
+ array2OI = (ListObjectInspector) arguments[ARRAY2_IDX];
checkArgCategory(arguments, ARRAY2_IDX, ObjectInspector.Category.LIST,
FUNC_NAME,
org.apache.hadoop.hive.serde.serdeConstants.LIST_TYPE_NAME); //Array1
is already getting validated in Parent class
+ arrayElementOI = arrayOI.getListElementObjectInspector();
+ array2ElementOI = array2OI.getListElementObjectInspector();
Review Comment:
Removed all those variables
--
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]