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
merge fails when column name conflicts with alias source #1476
merge fails when column name conflicts with alias source
description
using the spark bigquery connector with dynamic partition overwrite generates a merge query that fails when a column is named source.
the query uses source as both:
table alias
column name
reproduction
createtable `target_table` (
`id` int64,
`source` string
);
createtable `source_table` (
`id` int64,
`source` string
);
merge `target_table`as target
using `source_table`as source
on false
when not matched by target then
insert (`id`, `source`)
values (`id`, `source`);
error
value has type struct which cannot be inserted into column source (string)
cause
spark bigquery connector generates merge with unqualified columns. source resolves to the alias instead of the column.
this will have similar resolution issue for target
I have merged PR #1477 to resolve this issue by using random UUIDs enclosed in backticks for table aliases in the generated MERGE queries, which avoids conflicts with columns named 'source' or 'target'." It will be available in the upcoming release.
Activity
Issue #1476: Fix ambiguous aliases target and source in BigQuery MER…
BoqianShi commentedon Apr 12, 2026
Hi @chriskathumbi,
I have merged PR #1477 to resolve this issue by using random UUIDs enclosed in backticks for table aliases in the generated MERGE queries, which avoids conflicts with columns named 'source' or 'target'." It will be available in the upcoming release.
Thanks for reporting this issue!