【问题标题】:Facing '403 Exceeded rate limits: too many table update operations for this table' while loading BQ table加载 BQ 表时面临“403 Exceeded rate limits: too many table update operations for this table”
【发布时间】:2022-10-06 23:42:21
【问题描述】:

问题摘要

加载 bigquery 表时遇到问题

google.api_core.exceptions.Forbidden: 403 Exceeded rate limits: too 此表的许多表更新操作

此任务在 Airflow 中执行。

注意:实际上 DAG 正在并行处理 20 多个表,并且 {table}_count 任务正在将计数加载到单个表的同一个 BQ 表中。验证任务将在最后从同一个加载的表中获取数据。

def create_load_count_task(db_name, gcs_name, table_name):
    task = python_operator.PythonOperator(
        task_id=f\'my_{table_name}_count\',
        op_kwargs={
            \'dataset_name\': DATASET,
            \'file_name\' : f\'{table_name}_metadata.json\',
            \'file_prefix\': f\'{gcs_name}\',
            \'table_name\': f\'my_table_in_bq\',
            \'table_load_type\': bigquery.WriteDisposition.WRITE_APPEND,
        },           
        python_callable=load_into_bq
    )
    
    return task


with open(f\'mypath/tables.conf\') as fp:
    for count, line in enumerate(fp):
        config = line.split(\':\')

        db_name = config[0].strip()
        gcs_name = config[1].strip()
        table_name = config[2].strip()
 
        load = < my code >
        check = < my code >
        verify = < my code >
        init = < my code >
        load_count = create_load_count_task(db_name,gcs_name,table_name)

        print_dag_info >> check >> init >> load_count >> load >> verify

我的分析

我认为并行加载和获取导致问题。

我的尝试

我想实现 delay_retry 气流操作符,因为 10 秒会在第一次失败后延迟任务执行。

在这种情况下请帮助我。

标签: google-bigquery airflow


【解决方案1】:

检查您是否在 python 函数之外编写任何 bigquery 更新语句。 bigquery 还限制每个表每天 1500 次 DMl 操作。

【讨论】:

    猜你喜欢
    • 2020-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-08
    • 2015-04-12
    • 2015-05-11
    • 1970-01-01
    相关资源
    最近更新 更多