Yifan Zhang has uploaded this change for review. ( http://gerrit.cloudera.org:8080/23698
Change subject: IMPALA-9509: Add array_contains() for primitive types ...................................................................... IMPALA-9509: Add array_contains() for primitive types This patch adds support for built-in function array_contains(). The function supports primitive types (BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING) and NULL values are handled as follows: - Returns NULL if the array is NULL - Returns NULL if the search element is NULL - Skips NULL elements within the array during comparison Limitations: - TIMESTAMP, DECIMAL and DATE types are not supported. - Complex types(ARRAY<ARRAY<T>>, ARRAY<STRUCT<...>>) are not supported. Testing: - EE tests are added in test_array_contains.py - Note: BE unit tests in expr-test.cc are not added because IMPALA-9559 (Implement constructors for complex types) and IMPALA-11893 (Allow cast from NULL to complex types) are not yet implemented, which prevents constructing ARRAY literals in SQL expressions for testing purposes Change-Id: I751cc9f6c7f785f5269c7203fd753ec9aa2a9e78 --- M be/src/codegen/impala-ir.cc M be/src/exprs/CMakeLists.txt M be/src/exprs/anyval-util.cc M be/src/exprs/anyval-util.h A be/src/exprs/collection-functions-ir.cc A be/src/exprs/collection-functions.h M be/src/exprs/scalar-expr-evaluator.cc M be/src/runtime/collection-value.h M be/src/runtime/types.h M be/src/udf/udf.h M be/src/util/symbols-util.cc M common/function-registry/gen_builtins_catalog.py M common/function-registry/impala_functions.py M fe/src/main/java/org/apache/impala/catalog/ArrayType.java M fe/src/main/java/org/apache/impala/catalog/MapType.java M fe/src/main/java/org/apache/impala/catalog/StructType.java M fe/src/main/java/org/apache/impala/util/FunctionUtils.java A testdata/workloads/functional-query/queries/QueryTest/array-contains.test A tests/query_test/test_array_contains.py 19 files changed, 727 insertions(+), 6 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/98/23698/1 -- To view, visit http://gerrit.cloudera.org:8080/23698 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I751cc9f6c7f785f5269c7203fd753ec9aa2a9e78 Gerrit-Change-Number: 23698 Gerrit-PatchSet: 1 Gerrit-Owner: Yifan Zhang <[email protected]>
