Ali Alsuliman has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/2794
Change subject: [NO ISSUE][FUN] Add docs for array_fun
......................................................................
[NO ISSUE][FUN] Add docs for array_fun
- user model changes: no
- storage format changes: no
- interface changes: no
details:
add docs for array functions and remove error codes from
error messages in test suite.
Change-Id: I908338a7db9c0aa0b30acc6f9810327604a8368c
---
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayContainsDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayDistinctDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayIntersectDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayPositionDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRangeDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRemoveDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRepeatDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReplaceDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReverseDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySortDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayStarDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffnDescriptor.java
M
asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayUnionDescriptor.java
15 files changed, 189 insertions(+), 11 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/94/2794/1
diff --git
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 2adba01..be153f8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -1089,8 +1089,8 @@
<compilation-unit name="array_replace">
<output-dir compare="Text">array_replace</output-dir>
<expected-error>Cannot compare non-primitive values (in line 27, at
column 8)</expected-error>
- <expected-error>ASX1087: Invalid number of arguments for function
array-replace (in line 27, at column 8)</expected-error>
- <expected-error>ASX1087: Invalid number of arguments for function
array-replace (in line 27, at column 8)</expected-error>
+ <expected-error>Invalid number of arguments for function array-replace
(in line 27, at column 8)</expected-error>
+ <expected-error>Invalid number of arguments for function array-replace
(in line 27, at column 8)</expected-error>
</compilation-unit>
</test-case>
<test-case FilePath="array_fun">
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayContainsDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayContainsDescriptor.java
index 16bb0c9..5443834 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayContainsDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayContainsDescriptor.java
@@ -37,14 +37,15 @@
/**
* <pre>
- * array_contains(list, val) returns true if the the input list contains the
value argument.
+ * array_contains(list, val) returns true if the the input list contains the
value argument. It's case-sensitive to
+ * string value argument.
*
* It throws an error at compile time if the number of arguments != 2
*
* It returns (or throws an error at runtime) in order:
* 1. missing, if any argument is missing.
* 2. null, if any argument is null.
- * 3. an error if the value is of a list/object type (i.e. derived type) since
deep equality is not yet supported.
+ * 3. an error if the value is a list/object type (i.e. derived type) since
deep equality is not yet supported.
* 4. null, if the input list is not a list.
* 5. otherwise, returns true or false.
*
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayDistinctDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayDistinctDescriptor.java
index b74ec6a..9aa05e9 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayDistinctDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayDistinctDescriptor.java
@@ -50,6 +50,24 @@
import org.apache.hyracks.data.std.api.IPointable;
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
+/**
+ * <pre>
+ * array_distinct(list) returns a new list with distinct items of the input
list. The returned list has the same type as
+ * the input list. The list can contain null and missing items. Null and
missing are considered to be the same.
+ * It's case-sensitive to string items.
+ *
+ * array_distinct([1,2,null,4,missing,2,1]) will output [1,2,null,4]
+ *
+ * It throws an error at compile time if the number of arguments != 1
+ *
+ * It returns (or throws an error at runtime) in order:
+ * 1. missing, if any argument is missing.
+ * 2. null, if the list arg is null or it's not a list.
+ * 3. an error if any list item is a list/object type (i.e. derived type)
since deep equality is not yet supported.
+ * 4. otherwise, a new list.
+ *
+ * </pre>
+ */
public class ArrayDistinctDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
private IAType inputListType;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayIntersectDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayIntersectDescriptor.java
index f84dee7..9e48730 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayIntersectDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayIntersectDescriptor.java
@@ -62,6 +62,24 @@
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+/**
+ * <pre>
+ * array_intersect(list1, list2, ...) returns a new open list containing items
that are present in all of the input
+ * lists. Null and missing items are ignored. It's case-sensitive to string
items.
+ *
+ * array_intersect([null, 2, missing], [3,missing,2,null]) will result in [2].
+ *
+ * It throws an error at compile time if the number of arguments < 2
+ *
+ * It returns (or throws an error at runtime) in order:
+ * 1. missing, if any argument is missing.
+ * 2. an error if the input lists are not of the same type (one is an ordered
list while the other is unordered).
+ * 3. null, if any input list is null or is not a list.
+ * 4. an error if any list item is a list/object type (i.e. derived type)
since deep equality is not yet supported.
+ * 5. otherwise, a new open list.
+ *
+ * </pre>
+ */
public class ArrayIntersectDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayPositionDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayPositionDescriptor.java
index e4e54f1..411e846 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayPositionDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayPositionDescriptor.java
@@ -37,7 +37,7 @@
/**
* <pre>
* array_position(list, val) returns the 0-based position (as integer) of the
value argument in the input list. If the
- * value does not exists, it returns -1
+ * value does not exists, it returns -1. It's case-sensitive to string value
argument.
*
* It throws an error at compile time if the number of arguments != 2
*
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRangeDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRangeDescriptor.java
index 4068101..51ab331 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRangeDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRangeDescriptor.java
@@ -44,6 +44,22 @@
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+/**
+ * <pre>
+ * array_range(start_num, end_num, step_num?) returns a new closed ordered
list, list of long items or double items
+ * depending on the supplied arguments. One floating-point arg will make it a
list of double items. stem_num is optional
+ * where the default is 1. It returns an empty list for arguments like:
+ * array_range(2, 20, -2), array_range(10, 3, 4) and array_range(1,6,0) where
it cannot determine a proper sequence.
+ *
+ * It throws an error at compile time if the number of arguments < 2 or > 3
+ *
+ * It returns in order:
+ * 1. missing, if any argument is missing.
+ * 2. null, if any argument is null or they are not numeric. TODO: need to
decide on what to do for NaN +-INF
+ * 3. otherwise, a new closed list.
+ *
+ * </pre>
+ */
public class ArrayRangeDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRemoveDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRemoveDescriptor.java
index ea27017..814142a 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRemoveDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRemoveDescriptor.java
@@ -45,15 +45,15 @@
/**
* <pre>
* array_remove(list, val1, val2, ...) returns a new (open or closed) list
with all the values removed from the input
- * list. Values cannot be null (i.e., one cannot remove nulls).
+ * list. Values cannot be null (i.e., one cannot remove nulls). It's
case-sensitive to string value arguments.
*
* It throws an error at compile time if the number of arguments < 2
*
* It returns (or throws an error at runtime) in order:
* 1. missing, if any argument is missing.
* 2. null, if any argument is null.
- * 4. an error if any value arg is of a list/object type (i.e. derived type)
since deep equality is not yet supported.
- * 3. otherwise, a new list that has the same type as the input list.
+ * 3. an error if any value arg is of a list/object type (i.e. derived type)
since deep equality is not yet supported.
+ * 4. otherwise, a new list that has the same type as the input list.
*
* </pre>
*/
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRepeatDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRepeatDescriptor.java
index ce9d3cc..dc2a735 100644
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRepeatDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayRepeatDescriptor.java
@@ -43,6 +43,19 @@
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+/**
+ * <pre>
+ * array_repeat(val, num_times) returns a new closed ordered list with the
same item type as the input value.
+ *
+ * It throws an error at compile time if the number of arguments != 2
+ *
+ * It returns in order:
+ * 1. missing, if any argument is missing.
+ * 2. null, if any argument is null or num_times is not numeric. TODO: should
decide what to do for floating-points.
+ * 3. otherwise, a new closed ordered list.
+ *
+ * </pre>
+ */
public class ArrayRepeatDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReplaceDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReplaceDescriptor.java
index e8d77a8..c076258 100644
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReplaceDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReplaceDescriptor.java
@@ -54,6 +54,27 @@
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+/**
+ * <pre>
+ * array_replace(list, val1, val2, max_num_times?) returns a new open list
with the occurrences of val1 replaced with
+ * val2. max_num_times arg is optional. If supplied, it replaces val1 as many
as max_num_times. Any negative number for
+ * max_num_times means "replace all occurrences". val2 can be null meaning you
can replace existing items with nulls.
+ *
+ * array_replace([2,3,3,3,1], 3, 8, 0) will do nothing and result in
[2,3,3,3,1].
+ *
+ * It throws an error at compile time if the number of arguments < 3 or > 4
+ *
+ * It returns (or throws an error at runtime) in order:
+ * 1. missing, if any argument is missing.
+ * 2. null, if:
+ * - any argument is null (except for val2).
+ * - input list is not a list.
+ * - num_times is not numeric or it's a floating-point number with decimals,
e.g, 3.2 (3.0 is OK).
+ * 3. an error if val1 is a list/object type (i.e. derived type) since deep
equality is not yet supported.
+ * 4. otherwise, a new open list.
+ *
+ * </pre>
+ */
public class ArrayReplaceDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
private IAType inputListType;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReverseDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReverseDescriptor.java
index 331c9a4..4439878 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReverseDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayReverseDescriptor.java
@@ -40,8 +40,18 @@
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
/**
- * array_reverse(list) returns a new list with the entries of the original
input list in reverse order. If the input is
- * not a list, it returns "null".
+ * <pre>
+ * array_reverse(list) returns a new list with the entries of the original
input list in reverse order.
+ * The returned list has the same type as the input list. The list can contain
null/missing items. Both are preserved.
+ *
+ * It throws an error at compile time if the number of arguments != 1
+ *
+ * It returns in order:
+ * 1. missing, if any argument is missing.
+ * 2. null, if the list arg is null or it's not a list.
+ * 3. otherwise, a new open list.
+ *
+ * </pre>
*/
public class ArrayReverseDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySortDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySortDescriptor.java
index f99fc4c..ec81df5 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySortDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySortDescriptor.java
@@ -47,6 +47,22 @@
import org.apache.hyracks.data.std.api.IPointable;
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
+/**
+ * <pre>
+ * array_sort(list) returns a new list with the items sorted in ascending
order. The returned list has the same type as
+ * the input list. The list can contain null and missing items, and both are
preserved. It's case-sensitive to string
+ * items.
+ *
+ * It throws an error at compile time if the number of arguments != 1
+ *
+ * It returns (or throws an error at runtime) in order:
+ * 1. missing, if any argument is missing.
+ * 2. null, if the list arg is null or it's not a list.
+ * 3. an error if any list item is a list/object type (i.e. derived type)
since deep equality is not yet supported.
+ * 4. otherwise, a new list.
+ *
+ * </pre>
+ */
public class ArraySortDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
private static final ArraySortComparator COMP = new ArraySortComparator();
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayStarDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayStarDescriptor.java
index 217490b..09a0cfa 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayStarDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayStarDescriptor.java
@@ -54,6 +54,35 @@
import org.apache.hyracks.data.std.util.ArrayBackedValueStorage;
import org.apache.hyracks.dataflow.common.data.accessors.IFrameTupleReference;
+/**
+ * <pre>
+ * array_star(ordered_list) returns a new open object. The input ordered list
is supposed to be a list of objects:
+ * [{"id":1, "dept":"CS"}, {"id":2, "dept":"FIN"}, {"id":3, "dept":"CS"}]
+ * For the returned object, each field has a value = list of values of that
specific field taken from each object in the
+ * input list.
+ *
+ * Ex1: array_star([{"a":1, "b":2}, {"a":9, "b":4}]) will produce: {"a":[1,
9], "b":[2, 4]}
+ * Ex2: array_star([{"a":1}, {"a":9, "b":4}]) will produce: {"a":[1, 9],
"b":[null, 4]}
+ * Ex3: array_star([{"a":1, "c":5}, {"a":9, "b":4}]) will produce: {"a":[1,
9], "b":[null, 4], "c":[5,null]}
+ * Ex4: array_star([{"c":5, "a":1}, "non_object"]) will produce: {"a":[1,
null], "c":[5,null]}
+ * Ex5: array_star(["non_object1", "non_object2"]) will produce: {} (i.e.,
missing)
+ *
+ * Note that in the final object result, the fields are ordered by their names
regardless of their original order in the
+ * object items in the input list. "a" comes before "c". However, for every
field, all the items in each list must not
+ * be ordered. They should appear in the sequence they appear in the input
list.
+ * For Ex1, "a":[1,9] in the final result, item at index 0 comes from object
at index 0 (which is 1).
+ *
+ * It throws an error at compile time if the number of arguments != 1
+ *
+ * It returns in order:
+ * 1. missing, if any argument is missing.
+ * 2. null, if the list arg is null or it's not an ordered list.
+ * 3. missing, if input list is missing the notion of fields.
+ * E.g., the input list contains no object items (e.g., list of int), or
all objects have no fields.
+ * 4. otherwise, a new open object.
+ *
+ * </pre>
+ */
public class ArrayStarDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffDescriptor.java
index 4dce4df..61cf666 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffDescriptor.java
@@ -32,6 +32,24 @@
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
+/**
+ * <pre>
+ * array_symdiff(list1, list2, ...) returns a new open list based on the set
symmetric difference, or disjunctive union,
+ * of the input. The new list contains only those items that appear in exactly
one of the input lists.
+ * array_symdiff([null, 2,3], [missing, 3]) will result in [2, null, null]
where one null is for the missing item
+ * and the second null for the null item.
+ *
+ * It throws an error at compile time if the number of arguments < 2
+ *
+ * It returns (or throws an error at runtime) in order:
+ * 1. missing, if any argument is missing.
+ * 2. an error if the input lists are not of the same type (one is an ordered
list while the other is unordered).
+ * 3. null, if any input list is null or is not a list.
+ * 4. an error if any list item is a list/object type (i.e. derived type)
since deep equality is not yet supported.
+ * 5. otherwise, a new open list.
+ *
+ * </pre>
+ */
public class ArraySymDiffDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
private IAType[] argTypes;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffnDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffnDescriptor.java
index 26c438d..ac02d0d 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffnDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArraySymDiffnDescriptor.java
@@ -32,6 +32,24 @@
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;
+/**
+ * <pre>
+ * array_symdiffn(list1, list2, ...) returns a new open list based on the set
symmetric difference, or disjunctive
+ * union, of the input lists. The new list contains only those items that
appear in an odd number of input lists.
+ * array_symdiffn([null, 2,3], [missing, 3]) will result in [2, null, null]
where one null is for the missing item
+ * and the second null for the null item.
+ *
+ * It throws an error at compile time if the number of arguments < 2
+ *
+ * It returns (or throws an error at runtime) in order:
+ * 1. missing, if any argument is missing.
+ * 2. an error if the input lists are not of the same type (one is an ordered
list while the other is unordered).
+ * 3. null, if any input list is null or is not a list.
+ * 4. an error if any list item is a list/object type (i.e. derived type)
since deep equality is not yet supported.
+ * 5. otherwise, a new open list.
+ *
+ * </pre>
+ */
public class ArraySymDiffnDescriptor extends
AbstractScalarFunctionDynamicDescriptor {
private static final long serialVersionUID = 1L;
private IAType[] argTypes;
diff --git
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayUnionDescriptor.java
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayUnionDescriptor.java
index ccb86c1..1eca8ea 100755
---
a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayUnionDescriptor.java
+++
b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/ArrayUnionDescriptor.java
@@ -58,7 +58,7 @@
* 1. missing, if any argument is missing.
* 2. an error if the input lists are not of the same type (one is an ordered
list while the other is unordered).
* 3. null, if any input list is null or is not a list.
- * 4. an error if any list item is of a list/object type (i.e. derived type)
since deep equality is not yet supported.
+ * 4. an error if any list item is a list/object type (i.e. derived type)
since deep equality is not yet supported.
* 5. otherwise, a new open list.
*
* </pre>
--
To view, visit https://asterix-gerrit.ics.uci.edu/2794
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I908338a7db9c0aa0b30acc6f9810327604a8368c
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Ali Alsuliman <[email protected]>