This is an automated email from the ASF dual-hosted git repository.

gsaihemanth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new f60911a9285 HIVE-27628 - implement array_remove UDF in Hive (#4612) 
(Taraka Rama Rao Lethavadla, reviewed by Okumin, Sai Hemanth Gantasala)
f60911a9285 is described below

commit f60911a9285f3dd06e29d13c0cdc355f5d43035b
Author: tarak271 <[email protected]>
AuthorDate: Tue Aug 29 20:04:35 2023 +0530

    HIVE-27628 - implement array_remove UDF in Hive (#4612) (Taraka Rama Rao 
Lethavadla, reviewed by Okumin, Sai Hemanth Gantasala)
---
 .../hadoop/hive/ql/exec/FunctionRegistry.java      |   1 +
 .../hive/ql/udf/generic/GenericUDFArrayRemove.java |  79 +++++++++++
 .../ql/udf/generic/TestGenericUDFArrayRemove.java  | 150 +++++++++++++++++++++
 .../test/queries/clientpositive/udf_array_remove.q |  40 ++++++
 .../clientpositive/llap/show_functions.q.out       |   3 +
 .../clientpositive/llap/udf_array_remove.q.out     | 123 +++++++++++++++++
 6 files changed, 396 insertions(+)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
index bdcea8b8436..871980a6446 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java
@@ -612,6 +612,7 @@ public final class FunctionRegistry {
     system.registerGenericUDF("array_except", GenericUDFArrayExcept.class);
     system.registerGenericUDF("array_intersect", 
GenericUDFArrayIntersect.class);
     system.registerGenericUDF("array_union", GenericUDFArrayUnion.class);
+    system.registerGenericUDF("array_remove", GenericUDFArrayRemove.class);
     system.registerGenericUDF("deserialize", GenericUDFDeserialize.class);
     system.registerGenericUDF("sentences", GenericUDFSentences.class);
     system.registerGenericUDF("map_keys", GenericUDFMapKeys.class);
diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArrayRemove.java 
b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArrayRemove.java
new file mode 100644
index 00000000000..9571b83faad
--- /dev/null
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFArrayRemove.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hive.ql.udf.generic;
+
+import org.apache.hadoop.hive.ql.exec.Description;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentException;
+import org.apache.hadoop.hive.ql.exec.UDFArgumentTypeException;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.serde2.objectinspector.ListObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorUtils;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * GenericUDFArrayRemove.
+ */
+@Description(name = "array_remove", value = "_FUNC_(array, element) - Removes 
all occurrences of element from array.",
+    extended = "Example:\n" + "  > SELECT _FUNC_(array(1, 2, 3,4,2), 2) FROM 
src;\n"
+    + "  [1,3,4]")
+public class GenericUDFArrayRemove extends AbstractGenericUDFArrayBase {
+  private static final String FUNC_NAME = "ARRAY_REMOVE";
+  private static final int VALUE_IDX = 1;
+
+  public GenericUDFArrayRemove() {
+    super(FUNC_NAME, 2, 2, ObjectInspector.Category.LIST);
+  }
+
+  @Override
+  public ObjectInspector initialize(ObjectInspector[] arguments) throws 
UDFArgumentException {
+    ObjectInspector defaultOI = super.initialize(arguments);
+    ObjectInspector arrayElementOI = arrayOI.getListElementObjectInspector();
+
+    ObjectInspector valueOI = arguments[VALUE_IDX];
+
+    // Check if list element and value are of same type
+    if (!ObjectInspectorUtils.compareTypes(arrayElementOI, valueOI)) {
+      throw new UDFArgumentTypeException(VALUE_IDX,
+          String.format("%s type element is expected at function 
array_remove(array<%s>,%s), but %s is found",
+              arrayElementOI.getTypeName(), arrayElementOI.getTypeName(), 
arrayElementOI.getTypeName(),
+              valueOI.getTypeName()));
+    }
+    return defaultOI;
+  }
+
+  @Override
+  public Object evaluate(DeferredObject[] arguments) throws HiveException {
+
+    Object array = arguments[ARRAY_IDX].get();
+    Object value = arguments[VALUE_IDX].get();
+    if (arrayOI.getListLength(array) == 0) {
+      return Collections.emptyList();
+    } else if (arrayOI.getListLength(array) < 0 || value == null) {
+      return null;
+    }
+
+    List<?> resultArray = new ArrayList<>(((ListObjectInspector) 
argumentOIs[ARRAY_IDX]).getList(array));
+    resultArray.removeIf(value::equals);
+    return resultArray.stream().map(o -> 
converter.convert(o)).collect(Collectors.toList());
+  }
+}
diff --git 
a/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFArrayRemove.java
 
b/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFArrayRemove.java
new file mode 100644
index 00000000000..8826343716f
--- /dev/null
+++ 
b/ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFArrayRemove.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.udf.generic;
+
+import org.apache.hadoop.hive.common.type.Date;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.serde2.io.DateWritableV2;
+import org.apache.hadoop.hive.serde2.io.DoubleWritable;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector;
+import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspectorFactory;
+import 
org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory;
+import org.apache.hadoop.io.FloatWritable;
+import org.apache.hadoop.io.IntWritable;
+import org.apache.hadoop.io.Text;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static java.util.Arrays.asList;
+
+public class TestGenericUDFArrayRemove {
+  private final GenericUDFArrayRemove udf = new GenericUDFArrayRemove();
+
+  @Test public void testPrimitive() throws HiveException {
+    ObjectInspector[] inputOIs = { 
ObjectInspectorFactory.getStandardListObjectInspector(
+        PrimitiveObjectInspectorFactory.writableIntObjectInspector),
+        PrimitiveObjectInspectorFactory.writableIntObjectInspector };
+    udf.initialize(inputOIs);
+
+    Object i1 = new IntWritable(3);
+    Object i2 = new IntWritable(1);
+    Object i3 = new IntWritable(2);
+    Object i4 = new IntWritable(1);
+
+    runAndVerify(asList(i1, i2, i3, i4), i2, asList(i1, i3));
+    i1 = new FloatWritable(3.3f);
+    i2 = new FloatWritable(1.1f);
+    i3 = new FloatWritable(3.3f);
+    i4 = new FloatWritable(2.20f);
+    runAndVerify(asList(i1, i2, i3, i4), i1, asList(i2, i4));
+    runAndVerify(asList(i1, i2, i3, i4),null,null); //Test null element
+  }
+
+  @Test public void testList() throws HiveException {
+    ObjectInspector[] inputOIs = { 
ObjectInspectorFactory.getStandardListObjectInspector(
+        ObjectInspectorFactory.getStandardListObjectInspector(
+            PrimitiveObjectInspectorFactory.writableStringObjectInspector)),
+        ObjectInspectorFactory.getStandardListObjectInspector(
+            PrimitiveObjectInspectorFactory.writableStringObjectInspector) };
+    udf.initialize(inputOIs);
+
+    Object i1 = asList(new Text("aa1"), new Text("dd"), new Text("cc"), new 
Text("bb"));
+    Object i2 = asList(new Text("aa2"), new Text("cc"), new Text("ba"), new 
Text("dd"));
+    Object i3 = asList(new Text("aa3"), new Text("cc"), new Text("dd"), new 
Text("ee"), new Text("bb"));
+    Object i4 = asList(new Text("aa4"), new Text("cc"), new Text("ddd"), new 
Text("bb"));
+    runAndVerify(asList(i1, i2, i2, i3, i4, i4), i1, asList(i2, i2, i3, i4, 
i4));
+  }
+
+  @Test public void testStruct() throws HiveException {
+    ObjectInspector[] inputOIs = { 
ObjectInspectorFactory.getStandardListObjectInspector(
+        ObjectInspectorFactory.getStandardStructObjectInspector(asList("f1", 
"f2", "f3", "f4"),
+            
asList(PrimitiveObjectInspectorFactory.writableStringObjectInspector,
+                PrimitiveObjectInspectorFactory.writableDoubleObjectInspector,
+                PrimitiveObjectInspectorFactory.writableDateObjectInspector,
+                ObjectInspectorFactory.getStandardListObjectInspector(
+                    
PrimitiveObjectInspectorFactory.writableIntObjectInspector)))),
+        ObjectInspectorFactory.getStandardStructObjectInspector(asList("f1", 
"f2", "f3", "f4"),
+            
asList(PrimitiveObjectInspectorFactory.writableStringObjectInspector,
+                PrimitiveObjectInspectorFactory.writableDoubleObjectInspector,
+                PrimitiveObjectInspectorFactory.writableDateObjectInspector,
+                ObjectInspectorFactory.getStandardListObjectInspector(
+                    
PrimitiveObjectInspectorFactory.writableIntObjectInspector))) };
+    udf.initialize(inputOIs);
+
+    Object i1 = asList(new Text("a"), new DoubleWritable(3.1415), new 
DateWritableV2(Date.of(2015, 5, 26)),
+        asList(new IntWritable(1), new IntWritable(3), new IntWritable(2), new 
IntWritable(4)));
+
+    Object i2 = asList(new Text("b"), new DoubleWritable(3.14), new 
DateWritableV2(Date.of(2015, 5, 26)),
+        asList(new IntWritable(1), new IntWritable(3), new IntWritable(2), new 
IntWritable(4)));
+
+    Object i3 = asList(new Text("a"), new DoubleWritable(3.1415), new 
DateWritableV2(Date.of(2015, 5, 25)),
+        asList(new IntWritable(1), new IntWritable(3), new IntWritable(2), new 
IntWritable(5)));
+
+    Object i4 = asList(new Text("a"), new DoubleWritable(3.1415), new 
DateWritableV2(Date.of(2015, 5, 25)),
+        asList(new IntWritable(1), new IntWritable(3), new IntWritable(2), new 
IntWritable(4)));
+
+    runAndVerify(asList(i1, i3, i2, i3, i4, i2), i1, asList(i3, i2, i3, i4, 
i2));
+  }
+
+  @Test public void testxMap() throws HiveException {
+    ObjectInspector[] inputOIs = { 
ObjectInspectorFactory.getStandardListObjectInspector(
+        ObjectInspectorFactory.getStandardMapObjectInspector(
+            PrimitiveObjectInspectorFactory.writableStringObjectInspector,
+            PrimitiveObjectInspectorFactory.writableIntObjectInspector)),
+        ObjectInspectorFactory.getStandardMapObjectInspector(
+            PrimitiveObjectInspectorFactory.writableStringObjectInspector,
+            PrimitiveObjectInspectorFactory.writableIntObjectInspector) };
+    udf.initialize(inputOIs);
+
+    Map<Text, IntWritable> m1 = new HashMap<Text, IntWritable>();
+    m1.put(new Text("a"), new IntWritable(4));
+    m1.put(new Text("b"), new IntWritable(3));
+    m1.put(new Text("c"), new IntWritable(1));
+    m1.put(new Text("d"), new IntWritable(2));
+
+    Map<Text, IntWritable> m2 = new HashMap<Text, IntWritable>();
+    m2.put(new Text("d"), new IntWritable(4));
+    m2.put(new Text("b"), new IntWritable(3));
+    m2.put(new Text("a"), new IntWritable(1));
+    m2.put(new Text("c"), new IntWritable(2));
+
+    Map<Text, IntWritable> m3 = new HashMap<Text, IntWritable>();
+    m3.put(new Text("d"), new IntWritable(4));
+    m3.put(new Text("b"), new IntWritable(3));
+    m3.put(new Text("a"), new IntWritable(1));
+
+    runAndVerify(asList(m1, m3, m2, m3, m1), m1, asList(m3, m2, m3));
+  }
+
+  private void runAndVerify(List<Object> actual, Object element, List<Object> 
expected)
+      throws HiveException {
+    GenericUDF.DeferredJavaObject[] args = { new 
GenericUDF.DeferredJavaObject(actual), new 
GenericUDF.DeferredJavaObject(element) };
+    List<Object> result = (List<Object>) udf.evaluate(args);
+    if(expected == null){
+      Assert.assertEquals(result,null);
+    }
+    else {
+      Assert.assertArrayEquals("Check content", expected.toArray(), 
result.toArray());
+    }
+  }
+}
diff --git a/ql/src/test/queries/clientpositive/udf_array_remove.q 
b/ql/src/test/queries/clientpositive/udf_array_remove.q
new file mode 100644
index 00000000000..bb9389a5e34
--- /dev/null
+++ b/ql/src/test/queries/clientpositive/udf_array_remove.q
@@ -0,0 +1,40 @@
+--! qt:dataset:src
+
+-- SORT_QUERY_RESULTS
+
+set hive.fetch.task.conversion=more;
+
+DESCRIBE FUNCTION array_remove;
+DESCRIBE FUNCTION EXTENDED array_remove;
+
+-- evaluates function for array of primitives
+SELECT array_remove(array(1, 2, 3, null,3,4), 3);
+
+SELECT array_remove(array(1.12, 2.23, 3.34, null,1.11,1.12,2.9),1.12);
+
+SELECT array(1,2,3),array_remove(array(1, 2, 3),3);
+
+SELECT array(1,2,3),array_remove(array(1, 2, 3),5);
+
+SELECT array_remove(array(1.1234567890, 2.234567890, 3.34567890, null, 
3.3456789, 2.234567,1.1234567890),1.1234567890);
+
+SELECT array_remove(array(11234567890, 2234567890, 334567890, null, 
11234567890, 2234567890, 334567890, null),11234567890);
+
+SELECT 
array_remove(array(array("a","b","c","d"),array("a","b","c","d"),array("a","b","c","d","e"),null,array("e","a","b","c","d")),array("a","b","c","d"));
+
+# handle null array cases
+
+dfs ${system:test.dfs.mkdir} ${system:test.tmp.dir}/test_null_array;
+
+dfs -copyFromLocal ../../data/files/test_null_array.csv 
${system:test.tmp.dir}/test_null_array/;
+
+create external table test_null_array (id string, value Array<String>) ROW 
FORMAT DELIMITED
+ FIELDS TERMINATED BY ':' collection items terminated by ',' location 
'${system:test.tmp.dir}/test_null_array';
+
+select id,value from test_null_array;
+
+select array_remove(value,id) from test_null_array;
+
+select value, array_remove(value,id) from test_null_array;
+
+dfs -rm -r ${system:test.tmp.dir}/test_null_array;
\ No newline at end of file
diff --git a/ql/src/test/results/clientpositive/llap/show_functions.q.out 
b/ql/src/test/results/clientpositive/llap/show_functions.q.out
index 201801c4f59..3eab5bdb7cc 100644
--- a/ql/src/test/results/clientpositive/llap/show_functions.q.out
+++ b/ql/src/test/results/clientpositive/llap/show_functions.q.out
@@ -53,6 +53,7 @@ array_intersect
 array_join
 array_max
 array_min
+array_remove
 array_slice
 array_union
 ascii
@@ -555,6 +556,7 @@ PREHOOK: query: SHOW FUNCTIONS LIKE '%e'
 PREHOOK: type: SHOWFUNCTIONS
 POSTHOOK: query: SHOW FUNCTIONS LIKE '%e'
 POSTHOOK: type: SHOWFUNCTIONS
+array_remove
 array_slice
 assert_true
 case
@@ -678,6 +680,7 @@ array_intersect
 array_join
 array_max
 array_min
+array_remove
 array_slice
 array_union
 ascii
diff --git a/ql/src/test/results/clientpositive/llap/udf_array_remove.q.out 
b/ql/src/test/results/clientpositive/llap/udf_array_remove.q.out
new file mode 100644
index 00000000000..d0395c52284
--- /dev/null
+++ b/ql/src/test/results/clientpositive/llap/udf_array_remove.q.out
@@ -0,0 +1,123 @@
+PREHOOK: query: DESCRIBE FUNCTION array_remove
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION array_remove
+POSTHOOK: type: DESCFUNCTION
+array_remove(array, element) - Removes all occurrences of element from array.
+PREHOOK: query: DESCRIBE FUNCTION EXTENDED array_remove
+PREHOOK: type: DESCFUNCTION
+POSTHOOK: query: DESCRIBE FUNCTION EXTENDED array_remove
+POSTHOOK: type: DESCFUNCTION
+array_remove(array, element) - Removes all occurrences of element from array.
+Example:
+  > SELECT array_remove(array(1, 2, 3,4,2), 2) FROM src;
+  [1,3,4]
+Function class:org.apache.hadoop.hive.ql.udf.generic.GenericUDFArrayRemove
+Function type:BUILTIN
+PREHOOK: query: SELECT array_remove(array(1, 2, 3, null,3,4), 3)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT array_remove(array(1, 2, 3, null,3,4), 3)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+[1,2,null,4]
+PREHOOK: query: SELECT array_remove(array(1.12, 2.23, 3.34, 
null,1.11,1.12,2.9),1.12)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT array_remove(array(1.12, 2.23, 3.34, 
null,1.11,1.12,2.9),1.12)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+[2.23,3.34,null,1.11,2.9]
+PREHOOK: query: SELECT array(1,2,3),array_remove(array(1, 2, 3),3)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT array(1,2,3),array_remove(array(1, 2, 3),3)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+[1,2,3]        [1,2]
+PREHOOK: query: SELECT array(1,2,3),array_remove(array(1, 2, 3),5)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT array(1,2,3),array_remove(array(1, 2, 3),5)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+[1,2,3]        [1,2,3]
+PREHOOK: query: SELECT array_remove(array(1.1234567890, 2.234567890, 
3.34567890, null, 3.3456789, 2.234567,1.1234567890),1.1234567890)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT array_remove(array(1.1234567890, 2.234567890, 
3.34567890, null, 3.3456789, 2.234567,1.1234567890),1.1234567890)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+[2.23456789,3.3456789,null,3.3456789,2.234567]
+PREHOOK: query: SELECT array_remove(array(11234567890, 2234567890, 334567890, 
null, 11234567890, 2234567890, 334567890, null),11234567890)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT array_remove(array(11234567890, 2234567890, 334567890, 
null, 11234567890, 2234567890, 334567890, null),11234567890)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+[2234567890,334567890,null,2234567890,334567890,null]
+PREHOOK: query: SELECT 
array_remove(array(array("a","b","c","d"),array("a","b","c","d"),array("a","b","c","d","e"),null,array("e","a","b","c","d")),array("a","b","c","d"))
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT 
array_remove(array(array("a","b","c","d"),array("a","b","c","d"),array("a","b","c","d","e"),null,array("e","a","b","c","d")),array("a","b","c","d"))
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+#### A masked pattern was here ####
+[["a","b","c","d","e"],null,["e","a","b","c","d"]]
+PREHOOK: query: create external table test_null_array (id string, value 
Array<String>) ROW FORMAT DELIMITED
+#### A masked pattern was here ####
+PREHOOK: type: CREATETABLE
+#### A masked pattern was here ####
+PREHOOK: Output: database:default
+PREHOOK: Output: default@test_null_array
+POSTHOOK: query: create external table test_null_array (id string, value 
Array<String>) ROW FORMAT DELIMITED
+#### A masked pattern was here ####
+POSTHOOK: type: CREATETABLE
+#### A masked pattern was here ####
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@test_null_array
+PREHOOK: query: select id,value from test_null_array
+PREHOOK: type: QUERY
+PREHOOK: Input: default@test_null_array
+#### A masked pattern was here ####
+POSTHOOK: query: select id,value from test_null_array
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@test_null_array
+#### A masked pattern was here ####
+1      []
+2      ["NULL"]
+3      ["null","null"]
+PREHOOK: query: select array_remove(value,id) from test_null_array
+PREHOOK: type: QUERY
+PREHOOK: Input: default@test_null_array
+#### A masked pattern was here ####
+POSTHOOK: query: select array_remove(value,id) from test_null_array
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@test_null_array
+#### A masked pattern was here ####
+["NULL"]
+["null","null"]
+[]
+PREHOOK: query: select value, array_remove(value,id) from test_null_array
+PREHOOK: type: QUERY
+PREHOOK: Input: default@test_null_array
+#### A masked pattern was here ####
+POSTHOOK: query: select value, array_remove(value,id) from test_null_array
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@test_null_array
+#### A masked pattern was here ####
+["NULL"]       ["NULL"]
+["null","null"]        ["null","null"]
+[]     []

Reply via email to