Praxiteles
Praxiteles

Reputation: 6010

Prevent matches when querying multiple tables in BigQuery?

Is there any way to prevent certain tables from matching when querying multiple tables in BigQuery using Standard SQL?

We are trying to match tables with this pattern:

We would like to avoid matching tables with this pattern:

If we use wildcards as in "name_*" - we end up matching every table.

_TABLE_SUFFIX seems to face the same limitation.

Is there any way to regex or create exclusion criteria or other mechanism to prevent the matches we are trying to avoid?

Upvotes: 2

Views: 57

Answers (1)

Felipe Hoffa
Felipe Hoffa

Reputation: 59175

That's a good feature request for the issue tracker. For now, if you don't like how FROM * expands, you'll need to request for specific tables as in any other SQL database.

Issue tracker: https://issuetracker.google.com/savedsearches/559654

My own hack when doing this: I move/copy/create a view of the tables I'm interested in into another dataset, and then do the * expansion without having to deal with "pollution" from other table names.

Upvotes: 1

Related Questions