ArroyoSystems / arroyo

Distributed stream processing engine in Rust
https://arroyo.dev
Apache License 2.0
3.81k stars 220 forks source link

Array literals do not work in generated fields #697

Closed mwylde closed 2 weeks ago

mwylde commented 3 months ago

This query fails in planning:

create table input (
    length JSON,
    diff INT GENERATED ALWAYS AS (extract_json(length, '$.old')[1]) STORED
) with (
    connector = 'sse',
    endpoint = 'https://localhost:9091',
    format = 'json'
);

with the error

internal error: entered unreachable code: ListIndex should be rewritten in OperatorToFunction panic.file="/Users/mwylde/.cargo/git/checkouts/arrow-datafusion-152f78fee6ec2290/ca898b0/datafusion/physical-expr/src/planner.rs" panic.line=233 panic.column=21

It appears that a necessary optimization is not being run on generated field SQL