【问题标题】:Error: Response too large to return in big query错误:响应太大而无法在大查询中返回
【发布时间】:2013-12-15 18:41:32
【问题描述】:

我正在尝试运行查询“select * from tablename”。 但它会抛出类似“Error: Response too large to return”之类的错误。

我能够处理其他一些包含 TB 数据的表。但是对于包含 294 MB 的表,我收到了这个错误。

我能够通过选择列名来选择表,但存在一些限制,无法处理选择查询中的所有列。 在我的选择查询中,我总共有 26 列,但我能够毫无错误地选择 16 列。 "从表名中选择 column1,column2,column3,....column16"。

表格的列和大小有什么关系吗?

请帮我解决这个问题。

大查询表详细信息:

总记录:683,038

表大小:294 MB

列数:26

【问题讨论】:

    标签: google-bigquery


    【解决方案1】:

    如果您尝试在查询中添加 LIMIT 子句怎么办?

    【讨论】:

      【解决方案2】:
      jobData = {'configuration': {'query': {'query': sql, 
                  'allowLargeResults': 'true',
                  'destinationTable':{ 
                              "projectId": "projectXYZ",
                              "tableId": "tableXYZ", 
                              "datasetId": "datasetXYZ", 
                                      }
                              }}}  
      

      您可以使用'writeDisposition'来指定是否覆盖目标表。

      'writeDisposition':'WRITE_TRUNCATE' # If the table already exists, 
                                          # BigQuery overwrites the table data.
      'writeDisposition':'WRITE_APPEND'   # If the table already exists, 
                                          # BigQuery appends the data to the table
      

      【讨论】:

        【解决方案3】:

        在您的作业配置中将 allowLargeResults 设置为 true。您还必须使用 allowLargeResults 标志指定目标表。

        如果通过 API 查询,

        "configuration": 
          {
            "query": 
            {
              "allowLargeResults": true,
              "query": "select uid from [project:dataset.table]"
              "destinationTable": [project:dataset.table]
        
            }
          }
        

        如果使用 bq 命令行工具,

        $ bq query --allow_large_results --destination_table "dataset.table" "select uid from [project:dataset.table]"

        如果使用浏览器工具,

        • 点击“启用选项”
        • 选择“允许大型结果”

        【讨论】:

        • 您能否告诉我如何在 Big Query Browser 工具中使用这些相同的选项。
        • 这是您从浏览器工具启用大结果的方法 -> 单击启用选项,选择要保存结果的表,然后选中允许大结果
        • 我怀疑我是否运行此查询,这将每次创建新表...当我再次查询此表时,它会抛出 ALLOWALLRESULT:tRUE。
        【解决方案4】:

        如果您尚未在作业配置中将 allowLargeResults 设置为 true,请尝试。

        我是 Big Query 的新手。请告诉我在哪里可以进行这些作业配置更改。

        【讨论】:

        • 你是如何运行查询的?你在使用网络界面吗?如果是这样,您可以单击“启用选项”按钮以显示高级查询选项,然后选择“允许大结果”。请注意,使用“allowLargeResults”时必须指定目标表
        • @Jordan Tigani...我正在使用 bigquery。它不会返回整个数据..你能帮我解决这个问题stackoverflow.com/questions/39424391/…
        猜你喜欢
        • 2012-06-16
        • 2015-05-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-01-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多