I was looking at the documentation but I haven’t found the way to Drop multiple tables using wild cards.
I was trying to do something like this but it doesn’t work:
DROP TABLE TABLE_DATE_RANGE([clients.sessions_], TIMESTAMP('2017-01-01'), TIMESTAMP('2017-05-31'))
Advertisement
Answer
I just used python to loop this and solve it using Graham example:
from subprocess import call return_code = call('bq rm -f -t dataset.' + table_name +'_'+ period + '', shell=True)