Arnab Karmakar has uploaded this change for review. (
http://gerrit.cloudera.org:8080/23709
Change subject: WIP: IMPALA-13552: Add CollectionVal support to UDF interface
and implement size()/length()
......................................................................
WIP: IMPALA-13552: Add CollectionVal support to UDF interface and implement
size()/length()
This patch enables the UDF interface to accept CollectionVal arguments
by extending the symbol mangling code to handle ARRAY and MAP types.
This architectural improvement allows all collection functions to be
implemented as regular UDFs rather than special expression types.
Changes:
- Extended symbols-util.cc to mangle TYPE_ARRAY and TYPE_MAP as
CollectionVal in function signatures
- Implemented size() and length() as UDFs in collection-functions.{h,cc}
- Registered functions in CollectionFunctionsBuiltins.java
- Both functions return the number of elements in a collection or NULL
This work is a child task of IMPALA-9519. While IMPALA-9519 focuses on
enabling complex types to flow through the UDF interface, this patch goes
further by actually implementing collection-aware UDFs (size()/length())
on top of the new CollectionVal support.
Testing:
- Backend unit tests for NULL, empty, and non-empty collections
- Integration tests covering SELECT, WHERE, HAVING, aggregations
- Tests for both size() and length() (aliases)
- Tests for nested arrays and maps
Change-Id: I85b50386790657ea035addb35eed959d71810ab2
---
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-test.cc
A be/src/exprs/collection-functions.cc
A be/src/exprs/collection-functions.h
M be/src/exprs/scalar-expr-evaluator.cc
M be/src/util/symbols-util.cc
A fe/src/main/java/org/apache/impala/analysis/CollectionFunctionsBuiltins.java
M fe/src/main/java/org/apache/impala/catalog/ArrayType.java
M fe/src/main/java/org/apache/impala/catalog/BuiltinsDb.java
M fe/src/main/java/org/apache/impala/catalog/MapType.java
M fe/src/main/java/org/apache/impala/util/FunctionUtils.java
A
testdata/workloads/functional-query/queries/QueryTest/collection-functions.test
A tests/query_test/test_collection_functions.py
17 files changed, 847 insertions(+), 2 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/09/23709/1
--
To view, visit http://gerrit.cloudera.org:8080/23709
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I85b50386790657ea035addb35eed959d71810ab2
Gerrit-Change-Number: 23709
Gerrit-PatchSet: 1
Gerrit-Owner: Arnab Karmakar <[email protected]>