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
{{ message }}
Repository navigation
[BUG] BigQuery statement MERGE ... WHEN NOT MATCHED BY TARGET #2421
BigQuery in the "merge ... when not matched " allows to define when it's not matched by target or by source
currently jsqlparser is failing with these kind of statemnt stating UnsupportedStatement
when_clause ::= matched_clause | not_matched_by_target_clause | not_matched_by_source_clause
matched_clause ::= WHEN MATCHED [ AND search_condition ] THEN { merge_update_clause | merge_delete_clause }
not_matched_by_target_clause ::= WHEN NOT MATCHED [BY TARGET] [ AND search_condition ] THEN merge_insert_clause
not_matched_by_source_clause ::= WHEN NOT MATCHED BY SOURCE [ AND search_condition ] THEN { merge_update_clause | merge_delete_clause }
SQL Example
MERGE INTO target_table AS tt
USING ( SELECT key, field FROM source_table) AS st
ON tt.key = st.key
WHEN NOT MATCHED BY TARGET THEN
INSERT (key, field)
VALUES (st.key, st.field)
WHEN NOT MATCHED BY SOURCE THEN DELETE
;
changed the title [-][FEATURE] BigQuery statement MERGE ... WHEN NOT MATCHED BY TARGET[/-][+][BUG] BigQuery statement MERGE ... WHEN NOT MATCHED BY TARGET[/+]on Apr 18, 2026
Activity
[-][FEATURE] BigQuery statement MERGE ... WHEN NOT MATCHED BY TARGET[/-][+][BUG] BigQuery statement MERGE ... WHEN NOT MATCHED BY TARGET[/+]feat: support MERGE ... WHEN NOT MATCHED BY TARGET / BY SOURCE (JSQLP…