如何避免与子选择连接时出现InternalError

时间:2012-12-07 03:15:41

标签: google-bigquery

运行连接两个子选择的查询时,我收到 internalError 。查询如下所示:

SELECT data_table.title AS name
FROM
  ( 
    SELECT id, title
    FROM
    [citrius-altrius-fortius:analyze.topic_735_1354233600], [citrius-altrius-fortius:analyze.topic_735_1354320000]
  ) AS  data_table
  INNER JOIN
  ( 
    SELECT id FROM
    [citrius-altrius-fortius:analyze.topic_735_1354233600], [citrius-altrius-fortius:analyze.topic_735_1354320000]
    WHERE
    UPPER(title) CONTAINS ("BUDGET")
  ) AS filter_table
ON data_table.id == filter_table.id

这是我得到的回复:

{
  "status": {
    "state": "DONE", 
    "errors": [
      {
        "reason": "internalError", 
        "message": "Unexpected. Please try again."
      }
    ], 
    "errorResult": {
      "reason": "internalError", 
      "message": "Unexpected. Please try again."
    }
  }, 
  "kind": "bigquery#job", 
  "statistics": {
    "endTime": "1354849344685", 
    "startTime": "1354849344148"
  }, 
  "jobReference": {
    "projectId": "citrius-altrius-fortius", 
    "jobId": "job_e870b1fe67b94897a157dfa4f60b9725"
  }, 
  "etag": "\"OLvSfkwPDZ7M36YVEFvi-PBaFQM/SnvQhZKTutJxTY1bJLqqdphkA00\"", 
  "configuration": {
    "query": {
      "createDisposition": "CREATE_IF_NEEDED", 
      "query": "SELECT data_table.title AS name\nFROM\n  ( \n    SELECT id, title\n    FROM\n    [citrius-altrius-fortius:analyze.topic_735_1354233600], [citrius-altrius-fortius:analyze.topic_735_1354320000]\n  ) AS  data_table\n  INNER JOIN\n  ( \n    SELECT id FROM\n    [citrius-altrius-fortius:analyze.topic_735_1354233600], [citrius-altrius-fortius:analyze.topic_735_1354320000]\n    WHERE\n    UPPER(title) CONTAINS (\"BUDGET\") LIMIT 1000\n  ) AS filter_table\nON data_table.id == filter_table.id\n;", 
      "destinationTable": {
        "projectId": "citrius-altrius-fortius", 
        "tableId": "anonba898655_04dc_4d8d_8c29_673a36ba4c9f", 
        "datasetId": "_6fff29df40f86299d525686858be44df27c8dfd0"
      }
    }
  }, 
  "id": "citrius-altrius-fortius:job_e870b1fe67b94897a157dfa4f60b9725", 
  "selfLink": "https://www.googleapis.com/bigquery/v2/projects/citrius-altrius-fortius/jobs/job_e870b1fe67b94897a157dfa4f60b9725"
}

标题 id 是纯字符串列(非重复)。两个表的大小都相当小(在连接的右侧添加限制1000不会改变任何东西)。但是,当我改变查询以仅使用一个表时:

SELECT data_table.title AS name
FROM
  ( 
    SELECT id, title
    FROM
    [citrius-altrius-fortius:analyze.topic_735_1354233600]
  ) AS  data_table
  INNER JOIN
  ( 
    SELECT id FROM
    [citrius-altrius-fortius:analyze.topic_735_1354233600]
    WHERE
    UPPER(title) CONTAINS ("BUDGET") LIMIT 1000
  ) AS filter_table
ON data_table.id == filter_table.id

每次都有效。 连接两个子选择的正确方法是什么(子选择)从多个表中选择?

1 个答案:

答案 0 :(得分:0)

您正在尝试在联接中执行表联合的已知错误: BigQuery - UNION on left side of JOIN == Unexpected. Please try again

我们正积极致力于修复。