Reputation: 4447
I've come across a strange issue with Google BigQuery where a query won't run if writing to a destination table (through the UI or API). The query does, however, work fine if I run from the UI and then use the "Save as Table" button to create a table.
This query fails with the error "An internal error occurred and the request could not be completed." if writing to a destination table but it works fine if not. Here's a job id that failed: realself-main:bquijob_75b7040f_152f29c8619.
SELECT
sponsorships.sponsorship_id AS sponsorship_id,
FROM rsdw.sponsorships sponsorships
JOIN EACH rsdw.sponsorship_sku sponsorship_sku ON sponsorship_sku.sponsorship_sku_id = sponsorships.sponsorship_sku_id
CROSS JOIN
(SELECT
dt
FROM rsdw.calendar
WHERE
dt <= CURRENT_TIMESTAMP()
and dt >= '2015-01-01 00:00:00 UTC'
) AS calendar
I tried simplifying the query and this version fails with a "Resources exceeded during query execution" error if writing to a table but works fine if not. A failing job id is realself-main:bquijob_75b7040f_152f29c8619.
SELECT
sponsorships.sponsorship_id AS sponsorship_id,
FROM rsdw.sponsorships sponsorships
CROSS JOIN
(SELECT
dt
FROM rsdw.calendar
WHERE
dt <= CURRENT_TIMESTAMP()
and dt >= '2015-01-01 00:00:00 UTC'
) calendar
Upvotes: 2
Views: 103
Reputation: 13994
There was indeed a problem with your project on BigQuery side (hence "Internal error"). This problem should be fully resolved now, and your queries should work when writing to table.
Upvotes: 2