|
|
@ -229,17 +229,19 @@ if 'action' in SYS_ARGS and SYS_ARGS['action'] in ['create','compute','migrate'
|
|
|
|
o_dataset = SYS_ARGS['o_dataset']
|
|
|
|
o_dataset = SYS_ARGS['o_dataset']
|
|
|
|
for table in tables:
|
|
|
|
for table in tables:
|
|
|
|
sql = " ".join(["SELECT ",",".join(table['fields']) ," FROM (",mytools.get_filtered_table(table,key),") as ",table['name']])
|
|
|
|
sql = " ".join(["SELECT ",",".join(table['fields']) ," FROM (",mytools.get_filtered_table(table,key),") as ",table['name']])
|
|
|
|
|
|
|
|
print ""
|
|
|
|
job = bq.QueryJobConfig()
|
|
|
|
print sql
|
|
|
|
job.destination = client.dataset(o_dataset).table(table['name'])
|
|
|
|
print ""
|
|
|
|
job.use_query_cache = True
|
|
|
|
# job = bq.QueryJobConfig()
|
|
|
|
job.allow_large_results = True
|
|
|
|
# job.destination = client.dataset(o_dataset).table(table['name'])
|
|
|
|
job.priority = 'INTERACTIVE'
|
|
|
|
# job.use_query_cache = True
|
|
|
|
job.time_partitioning = bq.table.TimePartitioning(type_=bq.table.TimePartitioningType.DAY)
|
|
|
|
# job.allow_large_results = True
|
|
|
|
|
|
|
|
# job.priority = 'INTERACTIVE'
|
|
|
|
r = client.query(sql,location='US',job_config=job)
|
|
|
|
# job.time_partitioning = bq.table.TimePartitioning(type_=bq.table.TimePartitioningType.DAY)
|
|
|
|
|
|
|
|
|
|
|
|
print [table['full_name'],' ** ',r.job_id,' ** ',r.state]
|
|
|
|
# r = client.query(sql,location='US',job_config=job)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# print [table['full_name'],' ** ',r.job_id,' ** ',r.state]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|