We are loading csv files into BigQuery. Each file will create a separate table.
When we select from these tables, we do this mostly with a table query liek so:
SELECT foo, bar
FROM TABLE_QUERY(name_stub,'table_id CONTAINS "_something" and msec_to_timestamp(creation_time) > date_add(current_timestamp(), -90, "day")'));
Now we have added new fields to the newer files. So instead of just having fields "foo" and "bar" we now additionally have "baz".
When I run the following query, I get the error, that the field "baz" does not exists on one of the older tables.
SELECT foo, bar, baz
FROM TABLE_QUERY(name_stub,'table_id CONTAINS "_something" and msec_to_timestamp(creation_time) > date_add(current_timestamp(), -90, "day")'));
Is there a way to select "baz" and just have a default value for tables that don't have the column?