运行连接两个子选择的查询时出现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"
}
title和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
它每次都有效。在它们(子选择)从多个表中选择的地方连接两个子选择的正确方法是什么?