Ejemplo n.º 1
0
def __query_out_remain_data(bq_client, table_name, condition, origin_dataset_name, temp_dataset_name):
    print "Save remaining data to %s:%s" % (temp_dataset_name, table_name)

    project_id = BQ_CONFIG.project
    select_remain_query_content = SELECT_REMAIN_QUERY % (origin_dataset_name, table_name, condition)
    return utils.query_into(
        bq_client, table_name, table_name, select_remain_query_content, origin_dataset_name, temp_dataset_name
    )
Ejemplo n.º 2
0
def __copy_table(
        bq_client, org_dataset, dest_dataset, table_name, dest_table_name):
  copy_table_content = COPY_QUERY % (org_dataset, table_name)
  return utils.query_into(bq_client, table_name, dest_table_name,
                          copy_table_content, org_dataset, dest_dataset)