Skip to content

[Feature](function) Support function ARRAY_CROSS_PRODUCT#3891

Merged
zclllyybb merged 1 commit into
apache:masterfrom
linrrzqqq:array-cross-product
Jun 3, 2026
Merged

[Feature](function) Support function ARRAY_CROSS_PRODUCT#3891
zclllyybb merged 1 commit into
apache:masterfrom
linrrzqqq:array-cross-product

Conversation

@linrrzqqq
Copy link
Copy Markdown
Contributor

Versions

  • dev
  • 4.x
  • 3.x
  • 2.1 or older (not covered by version/language sync gate)

Languages

  • Chinese
  • English
  • Japanese candidate translation needed

Docs Checklist

  • Checked by AI
  • Test Cases Built
  • Updated required version and language counterparts, or explained why not
  • If only one language changed, confirmed whether source/translation counterparts need sync

zclllyybb pushed a commit to apache/doris that referenced this pull request Jun 3, 2026
Issue Number: #48203

Related PR: #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

```
@zclllyybb zclllyybb merged commit 48e681c into apache:master Jun 3, 2026
3 checks passed
@linrrzqqq linrrzqqq deleted the array-cross-product branch June 3, 2026 10:42
linrrzqqq added a commit to linrrzqqq/doris that referenced this pull request Jun 3, 2026
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

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants