You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
When executing a MERGE statement with an async function in the "NOT MATCHED" clause, the query fails with an index out of bounds error.
Steps to Reproduce:
Create sequence:
CREATESEQUENCEtest_seq;
Create target and source tables:
CREATETABLEtarget_table (id int default nextval(test_seq), name varchar(50), value int);
CREATETABLEsource_table (id INT, name VARCHAR(50), value INT);
Insert data into the source table:
INSERT INTO source_table (name, value) VALUES ('Item1', 100);
Execute the MERGE statement:
MERGE INTO target_table AS target
USING source_table AS source
ONtarget.id=source.id
WHEN MATCHED THEN
UPDATESETtarget.name=source.name, target.value=source.value
WHEN NOT MATCHED THEN
INSERT (name, value) VALUES (source.name, source.value);
Observed Error:
APIError: QueryFailed: [1104] index out of bounds: the len is 2 but the index is 18446744073709551610
Expected Behavior:
The MERGE statement should execute successfully, inserting or updating records as specified.
Root Cause:
The databend does not properly support async functions (e.g., sequence nextval()) in the NOT MATCHED clause of MERGE.
The text was updated successfully, but these errors were encountered:
Issue Summary
Problem:
When executing a
MERGE
statement with an async function in the "NOT MATCHED" clause, the query fails with an index out of bounds error.Steps to Reproduce:
MERGE
statement:Observed Error:
Expected Behavior:
The
MERGE
statement should execute successfully, inserting or updating records as specified.Root Cause:
The databend does not properly support async functions (e.g., sequence nextval()) in the NOT MATCHED clause of MERGE.
The text was updated successfully, but these errors were encountered: