问题
I asked this question yesterday, I'm trying to write my legacy view in standard SQL.
My table is
FROM [myProject.Mydataset.ga_sessions_20171129]
ga_sessions_20171129 is my table id and the last part of its name shows the last date that the table is updated, so the next table for the next day will be 20171130
We used this code to update the table every day
FROM `project.dataset.ga_sessions_*`
WHERE _TABLE_SUFFIX = FORMAT_DATE('%Y%m%d', CURRENT_DATE())
But it didn't work and gave me this error:
Failed to save view. Views cannot be queried through prefix. Partial list of the matched views are:...
Later, we thought that because we have some tables like that ga_sessions_S_20171129, it caused some confusion, then we tried this
FROM `project.dataset.ga_sessions_20*` where _TABLE_SUFFIX = FORMAT_DATE('%y%m%d', CURRENT_DATE())
It still doesn't work. Does anyone have a clue about this?
回答1:
The ONLY explanation I see is that in same dataset you have view that has same prefix as other tables - which is project.dataset.ga_sessions_*
but wildcard table does not support views. The query returns an error if the wildcard table matches any views in the dataset
There are few more limitations for wildcard tables
来源:https://stackoverflow.com/questions/47563168/writing-legacy-views-in-standard-sql-format-in-bigquery