QueryExecutionContext

class aws_cdk.aws_stepfunctions_tasks.QueryExecutionContext(*, catalog_name=None, database_name=None)

Bases: object

Database and data catalog context in which the query execution occurs.

Parameters
  • catalog_name (Optional[str]) – Name of catalog used in query execution. Default: - No catalog

  • database_name (Optional[str]) – Name of database used in query execution. Default: - No database

See

https://docs.aws.amazon.com/athena/latest/APIReference/API_QueryExecutionContext.html

ExampleMetadata

infused

Example:

start_query_execution_job = tasks.AthenaStartQueryExecution(self, "Athena Start Query",
    query_string=sfn.JsonPath.format("select contacts where year={};", sfn.JsonPath.string_at("$.year")),
    query_execution_context=tasks.QueryExecutionContext(
        database_name="interactions"
    ),
    result_configuration=tasks.ResultConfiguration(
        encryption_configuration=tasks.EncryptionConfiguration(
            encryption_option=tasks.EncryptionOption.S3_MANAGED
        ),
        output_location=s3.Location(
            bucket_name="mybucket",
            object_key="myprefix"
        )
    ),
    integration_pattern=sfn.IntegrationPattern.RUN_JOB
)

Attributes

catalog_name

Name of catalog used in query execution.

Default
  • No catalog

Return type

Optional[str]

database_name

Name of database used in query execution.

Default
  • No database

Return type

Optional[str]