Athena engine version 3 functions - Amazon Athena

Athena engine version 3 functions

Functions in Athena engine version 3 are based on Trino. For information about Trino functions, operators, and expressions, see Functions and operators and the following subsections from the Trino documentation.

invoker_principal() function

The invoker_principal function is unique to Athena engine version 3 and is not found in Trino.

Returns a VARCHAR that contains the ARN of the principal (IAM role or Identity Center identity) that ran the query calling the function. For example, if the query invoker uses the permissions of an IAM role to run the query, the function returns the ARN of the IAM role. The role that runs the query must allow the LakeFormation:GetDataLakePrincipal action.

Usage

SELECT invoker_principal()

The following table shows an example result.

# _col0
1 arn:aws:iam::111122223333:role/Admin