External Catalog Functions
This section describes user-defined functions (UDFs) related to external schemas. You can use these UDFs to obtain information used for controlling access to your external data lakes, such as Amazon S3 and Amazon Glue resources.
SET_USER_ROLE_ARN
Binds the current DW user to an AWS IAM role through the role's Amazon Resource Name (ARN). If the current DW user is already bound to another AWS IAM role, calling SET_USER_ROLE_ARN
will overwrite the binding configuration.
Syntax
SET_USER_ROLE_ARN( 'arn:aws:<role_arn>' )
Arguments
<role_arn>
: the ARN of the AWS IAM role to bind.
GET_USER_ROLE_ARN
Obtains the ARN of the AWS IAM role that is bound to the current or specified DW user.
Syntax
GET_USER_ROLE_ARN( '<dw_user_name>' )
Arguments
<dw_user_name>
: the name of the DW user. If not specified, the ARN of the AWS IAM role bound to the current DW user will be returned.
If <dw_user_name>
is specified and the current DW user does not have permission to get the ARN of the AWS IAM role bound to the specified <dw_user_name>
, the function call will result in an error.
REMOVE_USER_ROLE_ARN
Unbinds the current or specified DW user from the corresponding AWS IAM role.
Syntax
REMOVE_USER_ROLE_ARN( '<dw_user_name>' )
Arguments
<dw_user_name>
: the DW username. If not specified, the current DW user will be unbound from the corresponding AWS IAM role.
If <dw_user_name>
is specified and the current DW user does not have permission to unbind the specified <dw_user_name>
from the corresponding AWS IAM role, the function call will result in an error.
SET_USER_ASYNC_RESULT_MAPPING
Binds an output location to the current DW user. The output location is used to store the results of asynchronous executions performed by the DW user.
Syntax
SET_USER_ASYNC_RESULT_MAPPING( '<output_location_arn>', '<output_location_ak>', '<output_location_sk>', '<output_location_path_prefix>' )
Arguments
-
<output_location_arn>
The ARN of the output location.
-
<output_location_ak>
The access key of the output location.
-
<output_location_sk>
The secret key of the output location.
-
<output_location_path_prefix>
The prefix of the path to the output location.
NoteIf you specify
<output_location_arn>
,<output_location_ak>
and<output_location_sk>
are optional. If you specify<output_location_ak>
and<output_location_sk>
,<output_location_arn>
is optional.
GET_USER_ASYNC_RESULT_MAPPING
Obtains the mapping information of the output location that is bound to the current or specified DW user. The output location is used to store the results of asynchronous executions by the DW user.
Syntax
GET_USER_ASYNC_RESULT_MAPPING( '<dw_user_name>' )
Arguments
-
<dw_user_name>
The name of the DW user. If not specified, the mapping information of the output location bound to the current DW user will be returned.
If <dw_user_name>
is specified and the current user does not have permission to get the output location bound to the specified <dw_user_name>
, the function call will result in an error.
REMOVE_USER_ASYNC_RESULT_MAPPING
Unbinds the current or specified DW user from the corresponding output location. The output location is used to store the results of asynchronous executions by the DW user.
Syntax
REMOVE_USER_ASYNC_RESULT_MAPPING( '<dw_user_name>' )
Arguments
<dw_user_name>
: the name of the DW user. If not specified, the current DW user will be unbound from the corresponding output location.
If <dw_user_name>
is specified and the current DW user does not have permission to unbind the specified <dw_user_name>
from the output location, the function call will result in an error.