[Feature](function) Support function ARRAY_CROSS_PRODUCT#64031
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
/review |
|
run buildall |
There was a problem hiding this comment.
Automated review summary:
No blocking correctness issues found in this PR. I reviewed the new BE array_cross_product implementation, FE Nereids registration/signature, alias handling for cross_product, FE constant folding implementation, BE unit coverage, and regression coverage. Existing inline review context had no prior comments, and there were no additional user-provided focus points.
Critical checkpoint conclusions:
- Goal/test coverage: The PR adds array_cross_product/cross_product for 3D arrays and includes BE unit tests plus regression tests covering aliases, constants, table columns, numeric coercion, top-level NULLs, nested NULL errors, and invalid dimensions.
- Scope/minimality: The change is focused on one scalar function and the required FE/BE registration paths.
- Concurrency/lifecycle: No new shared state, threads, locks, static initialization dependency, persistence, or lifecycle-sensitive ownership was introduced.
- Compatibility/protocol: No new thrift protocol, storage format, EditLog, or FE-BE transmitted field changes. The FE signature coerces arguments to ARRAY, matching the BE ColumnFloat32 implementation.
- Parallel paths: Both FE and BE register the canonical name and alias; FE constant folding and BE execution paths were checked.
- Null/error handling: Top-level NULL propagation and nested NULL rejection are handled consistently with the declared behavior; Status errors are propagated in BE.
- Performance/memory: The BE implementation is linear over rows with fixed-size output per non-null row and uses Doris column containers; no obvious hot-path excessive allocation or untracked large allocation issue was found.
- Observability/config/docs: No new configuration, metrics, or observability requirement is apparent for this scalar function.
User focus response: No additional user-provided review focus was present.
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
FE UT Coverage ReportIncrement line coverage |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 29469 ms |
TPC-DS: Total hot run time: 169519 ms |
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
FE Regression Coverage ReportIncrement line coverage |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
Issue Number: apache#48203 Related PR: apache#59223 doc: apache/doris-website#3891 Problem Summary: Support function `ARRAY_CROSS_PRODUCT` ```sql Doris> SELECT CROSS_PRODUCT([1, 2, 3], [2, 3, 4]); +-------------------------------------+ | CROSS_PRODUCT([1, 2, 3], [2, 3, 4]) | +-------------------------------------+ | [-1, 2, -1] | +-------------------------------------+ 1 row in set (0.021 sec) Doris> SELECT CROSS_PRODUCT([1, 2, 3], NULL); +--------------------------------+ | CROSS_PRODUCT([1, 2, 3], NULL) | +--------------------------------+ | NULL | +--------------------------------+ 1 row in set (0.009 sec) Doris> SELECT CROSS_PRODUCT([1, NULL, 3], [1, 2, 3]); ERROR 1105 (HY000): errCode = 2, detailMessage = (127.0.0.1)[INVALID_ARGUMENT]function array_cross_product cannot have null Doris> SELECT CROSS_PRODUCT([1, 2, 3, 4], [1, 2, 3, 4]); ERROR 1105 (HY000): errCode = 2, detailMessage = (127.0.0.1)[INVALID_ARGUMENT]function array_cross_product requires both input arrays to have exactly 3 elements, got 4 and 4 ```
Issue Number: #48203
Related PR: #59223
doc: apache/doris-website#3891
Problem Summary:
Support function
ARRAY_CROSS_PRODUCT