Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access Denied: Cannot Query fh-bigquery:reddit_comments Dataset from Google BigQuery #85

Open
uyeongkim opened this issue Jan 7, 2025 · 1 comment

Comments

@uyeongkim
Copy link

Hello,

I’m trying to query the public dataset fh-bigquery:reddit_comments but I’m getting an Access Denied error.
I've followed the instructions provided and tried running the query both via the Google Cloud Console and the bq command-line tool, but the issue persists.

Here’s the exact script provided by the author that I used:

TABLE=reddit

# For all data up to 2019.
TABLE_REGEX="^201[5678]_[01][0-9]$"

QUERY="SELECT * \
  FROM TABLE_QUERY(\
  [fh-bigquery:reddit_comments], \
  \"REGEXP_MATCH(table_id, '${TABLE_REGEX?}')\" )"

# Run the query.
echo "${QUERY?}" | bq query \
  --n 0 \
  --batch --allow_large_results \
  --destination_table ${DATASET?}.${TABLE?} \
  --use_legacy_sql=true

I also tried adapting the query to Standard SQL and running it directly in the Google Cloud Console, but I encountered the same Access Denied error.
Here’s the query I used:

SELECT * 
FROM `fh-bigquery.reddit_comments.INFORMATION_SCHEMA.TABLES` 
WHERE REGEXP_CONTAINS(table_id, r'^201[5678]_[01][0-9]$')

The error message I received is:

Access Denied: Table fh-bigquery:reddit_comments.INFORMATION_SCHEMA.TABLES: User does not have permission to query table fh-bigquery:reddit_comments.INFORMATION_SCHEMA.TABLES.

I also tried running your example script, but it resulted in the same error.


What I've Tried:

  • Running the author's provided script via the bq command-line tool.
  • Querying the dataset directly in the Google Cloud Console.
  • Ensuring my Google Cloud account is verified and has BigQuery access.

Expected Behavior:

I should be able to query the fh-bigquery:reddit_comments dataset without access issues, as it is advertised as a public dataset

Actual Behavior:

Received an Access Denied error when trying to query the dataset, both through the provided script and directly in the Google Cloud Console.


Additional Context:

Google BigQuery Version: Standard SQL
Command-line Tool: bq
Cloud Account: Verified Google Cloud account
If there are additional permissions required or any setup steps I’m missing, please let me know.

Thank you for your assistance!

@eeyuhao
Copy link

eeyuhao commented Jan 9, 2025

I encountered the same error that disallowed me to access the Reddit dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants