Description
Bigquery gets confused by tables that have a column with the same name in CASTs, and will try to cast the entire table instead of the column.
-- causes error, as foo is a struct
select cast(`foo` as STRING) as `foo`
from `data-playground-1234`.`myschema`.`foo`
-- works when table name is specified
select cast(`foo`.`foo` as STRING) as `foo`
from `data-playground-1234`.`myschema`.`foo`
I think this is a simple as adding table.name
here, like:
{%- set col_name = adapter.quote(table.name) + '.' + adapter.quote(col_name) if col_name in table_columns[table] else 'null' %}
Activity