Functions in Amazon Athena
For changes in functions between Athena engine versions, see Athena engine versioning. For a list of the time
zones that can be used with the AT TIME ZONE
operator, see Supported time zones.
Athena engine version 3
Functions in Athena engine version 3 are based on Trino. For information about Trino functions, operators,
and expressions, see Functions and
operators
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 |
Athena engine version 2
Functions in Athena engine version 2 are based on Presto 0.217
Note
Version-specific documentation for Presto 0.217 functions is no longer available. For
information about current Presto functions, operators, and expressions, see Presto functions and
operators