This is actually a little bit misleading: what is happening is that FLATTEN()
with anything that isn't just a table name needs an extra set of parentheses to distinguish the field you're flattening by from a table. In other words, if you do
SELECT ... FROM FLATTEN(TABLE_QUERY(...), foo)
the foo
field gets interpreted as a unioned table name (as in SELECT * from bar,foo
).
The workaround for this issue is simple: Add another set of parentheses. That is:
SELECT ... FROM
FLATTEN((TABLE_QUERY(nbr_pcrf, 'table_id CONTAINS "dump_"')), quotas)