Search code examples
google-oauthgoogle-bigquery

Getting the E-mail id of user in Bigquery


I am using Bigquery Java API. For authorization with Bigquery service,I am using Google OAuth 2.0.My question is :- How to get an E-mail ID of user who has granted the access on consent screen?

I am not able to find anything related to it. Is it possible to get an E-mail ID of the User. Can anyone help?
Thanks in advance :)


Solution

  • Just run

    SELECT CURRENT_USER()

    and this returns the current user's email

    You can find this, and more functions in the manual: https://cloud.google.com/bigquery/query-reference