I’m consistently getting this result back from BigQuery:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "internalError",
"message": "Unexpected. Please try again."
}
],
"code": 503,
"message": "Unexpected. Please try again."
}
}
The query that causes it is of the form:
SELECT y.f1, y.f2, y.f3, y.f4, y.f5, y.f6, y.f7,
t.f1, t.f2, t.f3, t.f4, t.f5, t.f6, t.f7
FROM
(
SELECT
f1, f2, f3, f4, f5, f6, f7
FROM
ds.data_20120503
WHERE
kind='A'
)
AS y
JOIN
(
SELECT
f1, f2, f3, f4, f5, f6, f7
FROM
ds.data_20120504
WHERE
kind='A'
)
AS t
ON y.f7 = t.f7
If I run just the subselects, they work fine, so I guess it has something to to with the ‘join’. Where should I go from here?
Looks like you’re hitting a bug in bigquery — when both join keys are named the same and are both returned in the results, we get an invalid schema and fail the query. I’ve filed this as a bug internally, hopefully will have a fix soon.
As a workaround, if you either remove y.f7 or t.f7 from the selected results (since you’re joining on their equality, including both as results is redundant). Alternately you can use an as clause in one of the selects to name it something else — as in
f7 as joinedF7.