Functions in Amazon Athena - Amazon Athena
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Functions in Amazon Athena

For changes in functions between Athena engine versions, see the Athena engine version reference. 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 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.


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. For the geospatial functions in Athena engine version 2, see Geospatial functions in Athena engine version 2.


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, or visit the subcategory links in this section.