Skip to content

Querying Public Data set #2374

Closed
Closed

Description

@Electricks94

I’m trying to run a Query trough the public Data in BigQuery using Java and Eclipse.
When I run my code, I get:

HTTP ERROR 500

Problem accessing /Getbigquery. Reason: 
    Server Error


Caused by:
com.google.cloud.bigquery.BigQueryException: Access Denied: Project bigquery-public-data: The user MyAdress@gmail.com does not have bigquery.jobs.create permission in project bigquery-public-data.

I the IAM my Mail Address has the Owner Role for BigQuery.

What I’m worried about is my BigQuery Console. The Public Data is not listed in my Project but separately and I can’t click on "copy table" to copy it to my Project because it says: "Required parameter is missing".

Isn’t it possible to query the public Dataset with Java from Eclipse or is there something else I must think of?

Activity

  1. michaelbausor commented on Aug 24, 2017

    @michaelbausor
    Contributor

    This is the key part of the error: The user MyAdress@gmail.com does not have bigquery.jobs.create permission in project bigquery-public-data.

    You will not be able to run a create query on the project bigquery-public-data. The user at MyAdress@gmail.com will have the Owner Role for BigQuery in your project, but not the public bigquery-public-data project. Try changing the project id set in your code to your own project - you should then be able to run the create query.

  2. added
    api: bigqueryIssues related to the BigQuery API.
    type: questionRequest for information or clarification. Not an issue.
    on Aug 24, 2017
  3. Electricks94 commented on Aug 24, 2017

    @Electricks94
    Author

    Thanks again!

    I took the name public data a little bit to literally.
    I ran the query over my own data and everything worked fine.

  4. michaelbausor commented on Aug 24, 2017

    @michaelbausor
    Contributor

    No worries! I'll close this out now.

  5. oaustegard commented on Mar 25, 2020

    @oaustegard

    A bit of necromancing here: I just encountered the very same issue, not when issuing any form of CREATE statement; rather just SELECTing data from a public dataset - the problem appears to have been that I had not yet selected a Project when attempting to execute the query. As soon as I did, the error went away. Google could do a lot better job catching that edge case and instructing the user accordingly.

  6. NelsonGaldeman commented on Nov 12, 2021

    @NelsonGaldeman

    A bit of necromancing here: I just encountered the very same issue, not when issuing any form of CREATE statement; rather just SELECTing data from a public dataset - the problem appears to have been that I had not yet selected a Project when attempting to execute the query. As soon as I did, the error went away. Google could do a lot better job catching that edge case and instructing the user accordingly.

    Same here, trying to do a SELECT and getting the exact same error

  7. LucyAFH commented on Jan 19, 2022

    @LucyAFH

    I'm still a bit confused, if the SQL query is SELECT * FROM bigquery-public-data.hacker_news.full then how would this be changed in order to avoid this error?

  8. oaustegard commented on Jan 19, 2022

    @oaustegard

    I just now tried running your example query:
    SELECT * FROM bigquery-public-data.hacker_news.full
    If a project was not selected from the top menu bar I get the following error:

    Unexpected error
    
    Request ID: 14848219036247285360
    

    I don't see any 500 HTTP errors though

    As soon as I select a project I can run the query(disappointingly slow at 49 sec, but still - it runs)

  9. LucyAFH commented on Jan 19, 2022

    @LucyAFH

    Thanks for the quick reply! What did you mean by select the project? If you mean in the BigQuery console, I am using the new interface and I have the project bigquery-public-data pinned. Even if I select my own project and then run that query I don't get an error, but maybe I am misunderstanding what you meant.

    My problem is slightly different to the original one posted here (5 years ago - wow!) but it could be a similar issue, I am trying to query bigquery-public-data using a service account through an application called airflow. When I query my own tables with the service account it works but when I try to query say bigquery-public-data.hacker_news.full it says Access Denied: Project bigquery-public-data. I thought that everyone should have access to bigquery-public-data so I'm a bit confused.

  10. LucyAFH commented on Jan 19, 2022

    @LucyAFH

    I think I might have figured out my issue and it doesn't have to do with what I thought after all. I was trying to create a new table using data in a bigquery public table which apparently you can't do (I get the error Access Denied). Will have to find out if there are any workarounds or if it is just not possible. Thanks again for your last reply though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions