Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot reference a standard SQL view in a legacy SQL query - GBQ & IICS

I am relatively new to GBQ. I am trying to create a mappping in IICS to copy one view from GBQ to create a table within GBQ. At this point I am not doing any transformations, just a source to target copy. I am getting the below error - [ERROR] The [QUERY] job failed with the error - [Cannot reference a standard SQL view in a legacy SQL query.]

Note that the IICS mapping is showing as valid and upon running the mapping the target table is dynamically getting created in GBQ but the mapping is failing throwing the above error. Please help.

Thanks

like image 428
Debojit Pal Avatar asked Jan 29 '26 23:01

Debojit Pal


1 Answers

BigQuery supports two SQL dialects: standard SQL and legacy SQL and they cannot be mixed while can perfectly be running separately and in parallel

So, in your case looks like you are have Query that is written in Legacy SQL and that query references the view written in Standard SQL

The best way to handle this "issue" is to rewrite your query using Standard SQL

See Migrating to Standard SQL for details

like image 95
Mikhail Berlyant Avatar answered Feb 02 '26 06:02

Mikhail Berlyant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!