You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many SQL sections in various notebooks where the instructions explore the information in the dataset uses OFFSET(1) while trying to extract the domain name stem as the source. Three labs are mentioned in the #2432 issue (with their name and Cloud Skills Boost URL) along with their notebook, but there are many more notebooks. Example query cell:
%%bigquery --project $PROJECT
SELECT
ARRAY_REVERSE(SPLIT(REGEXP_EXTRACT(url, '.*://(.[^/]+)/'), '.'))[OFFSET(1)] AS source,
COUNT(title) AS num_articles
FROM
`bigquery-public-data.hacker_news.full`
WHERE
REGEXP_CONTAINS(REGEXP_EXTRACT(url, '.*://(.[^/]+)/'), '.com$')
AND LENGTH(title) > 10
GROUP BY
source
ORDER BY num_articles DESC
LIMIT 100
Resulting error:
ERROR:
400 Array index 1 is out of bounds (overflow)
Location: US
Job ID: 389a7292-2c3b-4f14-8129-af10d4270423
MrCsabaToth
changed the title
OFFSET SQL function errors out while extracting info from bigquery-public-data.hacker_news.full dataset
OFFSET SQL function yields 400 array index 1 is out of bounds while extracting info from hacker_news dataset
Sep 10, 2023
MrCsabaToth
changed the title
OFFSET SQL function yields 400 array index 1 is out of bounds while extracting info from hacker_news dataset
OFFSET SQL function yields 400 Array index 1 is out of bounds while extracting info from hacker_news dataset
Sep 10, 2023
MrCsabaToth
added a commit
to MrCsabaToth/training-data-analyst
that referenced
this issue
Sep 10, 2023
Many SQL sections in various notebooks where the instructions explore the information in the dataset uses
OFFSET(1)
while trying to extract the domain name stem as the source. Three labs are mentioned in the #2432 issue (with their name and Cloud Skills Boost URL) along with their notebook, but there are many more notebooks. Example query cell:Resulting error:
A workaround is to use
SAFE_OFFSET
instead ofOFFSET
. A few other notebooks use that, and all notebooks use that in the https://github.com/GoogleCloudPlatform/asl-ml-immersion/ repo. I'll amend the PR#2433 with this.The text was updated successfully, but these errors were encountered: