Security functions

GoogleSQL for BigQuery supports the following security functions.

Function list

NameSummary
SESSION_USER Get the email address or principal identifier of the user that's running the query.

SESSION_USER

SESSION_USER()

Description

For first-party users, returns the email address of the user that's running thequery.For third-party users, returns theprincipal identifierof the user that's running the query.For more information about identities, seePrincipals.

Return Data Type

STRING

Example

SELECTSESSION_USER()asuser;/*----------------------+ | user                 | +----------------------+ | jdoe@example.com     | +----------------------*/

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-11-24 UTC.