Skip to content

[Bug](High) array_agg_foreach fails on APPEND_ONLY table streams with "array_agg not support write" #65976

Description

@MoanasDaddyXu

Tracking

Search before asking

  • I searched the existing issues and found no issue with the same ROW-binlog table-stream failure.
  • [Bug] array_agg_foreach funtion is broken #52252 concerns missing or unstable results when querying a regular table; this issue instead fails during an APPEND_ONLY table-stream query with NOT_IMPLEMENTED_ERROR.

Version

Reproduced on Doris commit a8b1fd95e2a.

What's Wrong?

Calling array_agg_foreach on an APPEND_ONLY table stream backed by ROW binlog fails during query execution:

[NOT_IMPLEMENTED_ERROR]array_agg not support write

The equivalent aggregation over the base table produces a result. The failure is specific to querying the table stream and also affects nested array input.

What You Expected?

array_agg_foreach should execute on the ROW-binlog table stream and return results with the same semantics as the corresponding base-table query.

How to Reproduce?

DROP DATABASE IF EXISTS array_agg_stream_repro;
CREATE DATABASE array_agg_stream_repro;
USE array_agg_stream_repro;

CREATE TABLE foreach_table (
    id INT,
    a ARRAY<INT>,
    b ARRAY<ARRAY<INT>>
)
DUPLICATE KEY(id)
DISTRIBUTED BY HASH(id) BUCKETS 1
PROPERTIES (
    "replication_num" = "1",
    "binlog.enable" = "true",
    "binlog.format" = "ROW"
);

CREATE STREAM foreach_table_stream ON TABLE foreach_table
PROPERTIES ("type" = "append_only");

INSERT INTO foreach_table VALUES
    (1, [1, 2, 3], [[1], [1, 2, 3], [2]]),
    (2, [20], [[2]]),
    (3, [100], [[1]]),
    (4, NULL, [NULL]),
    (5, [NULL, 2], [[2], NULL]);

-- The equivalent query on foreach_table succeeds.
SELECT array_agg_foreach(a) FROM foreach_table_stream;

SELECT /*+ SET_VAR(parallel_pipeline_task_num=1) */
    size(array_agg_foreach(b)),
    size(element_at(array_agg_foreach(b), 1)),
    size(element_at(array_agg_foreach(b), 2)),
    size(element_at(array_agg_foreach(b), 3))
FROM foreach_table_stream;

Both table-stream queries fail with the error above.

be.out

The following excerpt contains only the relevant, sanitized BE output:

Pipeline task failed. reason: [NOT_IMPLEMENTED_ERROR]array_agg not support write
report error status: array_agg not support write to coordinator

Impact

Queries that use array_agg_foreach cannot run against APPEND_ONLY table streams, blocking incremental-processing workloads that aggregate array columns.

Are you willing to submit PR?

  • Yes, I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions