def load_hist_job_run_tbl(etl_project_id): """ Loading the history control table basedon parameters """ insert_query = ConnectBqCtlTable.get_batch_insert_query( '{}'.format(etl_project_id)) query_job = (insert_query).format( etl_project_id, ExecuteBatch.batch_id) ##need to check job = ExecuteBatch.client.query(query_job) job.result()
def load_hist_job_run_tbl(etl_project_id): """ Loading the history control table basedon parameters """ insert_query = ConnectBqCtlTable.get_batch_insert_query( '{}'.format(etl_project_id)) query_job = (insert_query).format( etl_project_id, ExecuteBatch.batch_id) ##need to check job = ExecuteBatch.client.query(query_job) job.result() query = 'select max(batch_run_id) as batch_run_id, batch_name from `analytics-plp-uat.PLP_BQ_CTL_METADATA.PLP_BQ_CTL_BATCH_RUN_H` where batch_name = \'BCM_DCIM\' group by batch_name' job = ExecuteBatch.client.query(query) results = job.result() for row in results: print("batch_name : ", row.batch_name) print("batch_run_id : ", row.batch_run_id)