/AWS1/IF_ATH=>CREATEDATACATALOG()¶
About CreateDataCatalog¶
Creates (registers) a data catalog with the specified name and properties. Catalogs created are visible to all users of the same Amazon Web Services account.
For a FEDERATED catalog, this API operation creates the following
resources.
-
CFN Stack Name with a maximum length of 128 characters and prefix
athenafederatedcatalog-CATALOG_NAME_SANITIZEDwith length 23 characters. -
Lambda Function Name with a maximum length of 64 characters and prefix
athenafederatedcatalog_CATALOG_NAME_SANITIZEDwith length 23 characters. -
Glue Connection Name with a maximum length of 255 characters and a prefix
athenafederatedcatalog_CATALOG_NAME_SANITIZEDwith length 23 characters.
Method Signature¶
METHODS /AWS1/IF_ATH~CREATEDATACATALOG
IMPORTING
!IV_NAME TYPE /AWS1/ATHCATALOGNAMESTRING OPTIONAL
!IV_TYPE TYPE /AWS1/ATHDATACATALOGTYPE OPTIONAL
!IV_DESCRIPTION TYPE /AWS1/ATHDESCRIPTIONSTRING OPTIONAL
!IT_PARAMETERS TYPE /AWS1/CL_ATHPARAMETERSMAP_W=>TT_PARAMETERSMAP OPTIONAL
!IT_TAGS TYPE /AWS1/CL_ATHTAG=>TT_TAGLIST OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_athcredatacatalogout
RAISING
/AWS1/CX_ATHINTERNALSERVEREX
/AWS1/CX_ATHINVALIDREQUESTEX
/AWS1/CX_ATHCLIENTEXC
/AWS1/CX_ATHSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_name TYPE /AWS1/ATHCATALOGNAMESTRING /AWS1/ATHCATALOGNAMESTRING¶
The name of the data catalog to create. The catalog name must be unique for the Amazon Web Services account and can use a maximum of 127 alphanumeric, underscore, at sign, or hyphen characters. The remainder of the length constraint of 256 is reserved for use by Athena.
For
FEDERATEDtype the catalog name has following considerations and limits:
The catalog name allows special characters such as
, @ , \ , -. These characters are replaced with a hyphen (-) when creating the CFN Stack Name and with an underscore () when creating the Lambda Function and Glue Connection Name.The catalog name has a theoretical limit of 128 characters. However, since we use it to create other resources that allow less characters and we prepend a prefix to it, the actual catalog name limit for
FEDERATEDcatalog is 64 - 23 = 41 characters.
iv_type TYPE /AWS1/ATHDATACATALOGTYPE /AWS1/ATHDATACATALOGTYPE¶
The type of data catalog to create:
LAMBDAfor a federated catalog,GLUEfor an Glue Data Catalog, andHIVEfor an external Apache Hive metastore.FEDERATEDis a federated catalog for which Athena creates the connection and the Lambda function for you based on the parameters that you pass.For
FEDERATEDtype, we do not support IAM identity center.
Optional arguments:¶
iv_description TYPE /AWS1/ATHDESCRIPTIONSTRING /AWS1/ATHDESCRIPTIONSTRING¶
A description of the data catalog to be created.
it_parameters TYPE /AWS1/CL_ATHPARAMETERSMAP_W=>TT_PARAMETERSMAP TT_PARAMETERSMAP¶
Specifies the Lambda function or functions to use for creating the data catalog. This is a mapping whose values depend on the catalog type.
For the
HIVEdata catalog type, use the following syntax. Themetadata-functionparameter is required.The sdk-versionparameter is optional and defaults to the currently supported version.
metadata-function=lambda_arn, sdk-version=version_numberFor the
LAMBDAdata catalog type, use one of the following sets of required parameters, but not both.
If you have one Lambda function that processes metadata and another for reading the actual data, use the following syntax. Both parameters are required.
metadata-function=lambda_arn, record-function=lambda_arnIf you have a composite Lambda function that processes both metadata and data, use the following syntax to specify your Lambda function.
function=lambda_arnThe
GLUEtype takes a catalog ID parameter and is required. Thecatalog_idis the account ID of the Amazon Web Services account to which the Glue Data Catalog belongs.
catalog-id=catalog_id
The
GLUEdata catalog type also applies to the defaultAwsDataCatalogthat already exists in your account, of which you can have only one and cannot modify.The
FEDERATEDdata catalog type uses one of the following parameters, but not both. Useconnection-arnfor an existing Glue connection. Useconnection-typeandconnection-propertiesto specify the configuration setting for a new connection.
connection-arn:
lambda-role-arn(optional): The execution role to use for the Lambda function. If not provided, one is created.
connection-type:MYSQL|REDSHIFT|...., connection-properties:"" For
, use escaped JSON text, as in the following example.
"{\"spill_bucket\":\"my_spill\",\"spill_prefix\":\"athena-spill\",\"host\":\"abc12345.snowflakecomputing.com\",\"port\":\"1234\",\"warehouse\":\"DEV_WH\",\"database\":\"TEST\",\"schema\":\"PUBLIC\",\"SecretArn\":\"arn:aws:secretsmanager:ap-south-1:111122223333:secret:snowflake-XHb67j\"}"
it_tags TYPE /AWS1/CL_ATHTAG=>TT_TAGLIST TT_TAGLIST¶
A list of comma separated tags to add to the data catalog that is created. All the resources that are created by the
CreateDataCatalogAPI operation withFEDERATEDtype will have the tagfederated_athena_datacatalog="true". This includes the CFN Stack, Glue Connection, Athena DataCatalog, and all the resources created as part of the CFN Stack (Lambda Function, IAM policies/roles).
RETURNING¶
oo_output TYPE REF TO /aws1/cl_athcredatacatalogout /AWS1/CL_ATHCREDATACATALOGOUT¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->createdatacatalog(
it_parameters = VALUE /aws1/cl_athparametersmap_w=>tt_parametersmap(
(
VALUE /aws1/cl_athparametersmap_w=>ts_parametersmap_maprow(
value = new /aws1/cl_athparametersmap_w( |string| )
key = |string|
)
)
)
it_tags = VALUE /aws1/cl_athtag=>tt_taglist(
(
new /aws1/cl_athtag(
iv_key = |string|
iv_value = |string|
)
)
)
iv_description = |string|
iv_name = |string|
iv_type = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lo_datacatalog = lo_result->get_datacatalog( ).
IF lo_datacatalog IS NOT INITIAL.
lv_catalognamestring = lo_datacatalog->get_name( ).
lv_descriptionstring = lo_datacatalog->get_description( ).
lv_datacatalogtype = lo_datacatalog->get_type( ).
LOOP AT lo_datacatalog->get_parameters( ) into ls_row.
lv_key = ls_row-key.
lo_value = ls_row-value.
IF lo_value IS NOT INITIAL.
lv_parametersmapvalue = lo_value->get_value( ).
ENDIF.
ENDLOOP.
lv_datacatalogstatus = lo_datacatalog->get_status( ).
lv_connectiontype = lo_datacatalog->get_connectiontype( ).
lv_errormessage = lo_datacatalog->get_error( ).
ENDIF.
ENDIF.