TableProps

class aws_cdk.aws_glue_alpha.TableProps(*, columns, database, data_format, compressed=None, description=None, enable_partition_filtering=None, parameters=None, partition_indexes=None, partition_keys=None, storage_parameters=None, stored_as_sub_directories=None, table_name=None, bucket=None, encryption=None, encryption_key=None, s3_prefix=None)

Bases: S3TableProps

Parameters:
  • columns (Sequence[Union[Column, Dict[str, Any]]]) – (experimental) Columns of the table.

  • database (IDatabase) – (experimental) Database in which to store the table.

  • data_format (DataFormat) – (experimental) Storage type of the table’s data.

  • compressed (Optional[bool]) – (experimental) Indicates whether the table’s data is compressed or not. Default: false

  • description (Optional[str]) – (experimental) Description of the table. Default: generated

  • enable_partition_filtering (Optional[bool]) – (experimental) Enables partition filtering. Default: - The parameter is not defined

  • parameters (Optional[Mapping[str, str]]) – (experimental) The key/value pairs define properties associated with the table. The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed. Default: - The parameter is not defined

  • partition_indexes (Optional[Sequence[Union[PartitionIndex, Dict[str, Any]]]]) – (experimental) Partition indexes on the table. A maximum of 3 indexes are allowed on a table. Keys in the index must be part of the table’s partition keys. Default: table has no partition indexes

  • partition_keys (Optional[Sequence[Union[Column, Dict[str, Any]]]]) – (experimental) Partition columns of the table. Default: table is not partitioned

  • storage_parameters (Optional[Sequence[StorageParameter]]) – (experimental) The user-supplied properties for the description of the physical storage of this table. These properties help describe the format of the data that is stored within the crawled data sources. The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed. Some keys will be auto-populated by glue crawlers, however, you can override them by specifying the key and value in this property. Default: - The parameter is not defined

  • stored_as_sub_directories (Optional[bool]) – (experimental) Indicates whether the table data is stored in subdirectories. Default: false

  • table_name (Optional[str]) – (experimental) Name of the table. Default: - generated by CDK.

  • bucket (Optional[IBucket]) – (experimental) S3 bucket in which to store data. Default: one is created for you

  • encryption (Optional[TableEncryption]) – (experimental) The kind of encryption to secure the data with. You can only provide this option if you are not explicitly passing in a bucket. If you choose SSE-KMS, you can provide an un-managed KMS key with encryptionKey. If you choose CSE-KMS, you must provide an un-managed KMS key with encryptionKey. Default: BucketEncryption.S3_MANAGED

  • encryption_key (Optional[IKey]) – (experimental) External KMS key to use for bucket encryption. The encryption property must be SSE-KMS or CSE-KMS. Default: key is managed by KMS.

  • s3_prefix (Optional[str]) – (experimental) S3 prefix under which table objects are stored. Default: - No prefix. The data will be stored under the root of the bucket.

Stability:

experimental

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_glue_alpha as glue_alpha
from aws_cdk import aws_kms as kms
from aws_cdk import aws_s3 as s3

# bucket: s3.Bucket
# database: glue_alpha.Database
# data_format: glue_alpha.DataFormat
# key: kms.Key
# storage_parameter: glue_alpha.StorageParameter

table_props = glue_alpha.TableProps(
    columns=[glue_alpha.Column(
        name="name",
        type=glue_alpha.Type(
            input_string="inputString",
            is_primitive=False
        ),

        # the properties below are optional
        comment="comment"
    )],
    database=database,
    data_format=data_format,

    # the properties below are optional
    bucket=bucket,
    compressed=False,
    description="description",
    enable_partition_filtering=False,
    encryption=glue_alpha.TableEncryption.S3_MANAGED,
    encryption_key=key,
    parameters={
        "parameters_key": "parameters"
    },
    partition_indexes=[glue_alpha.PartitionIndex(
        key_names=["keyNames"],

        # the properties below are optional
        index_name="indexName"
    )],
    partition_keys=[glue_alpha.Column(
        name="name",
        type=glue_alpha.Type(
            input_string="inputString",
            is_primitive=False
        ),

        # the properties below are optional
        comment="comment"
    )],
    s3_prefix="s3Prefix",
    storage_parameters=[storage_parameter],
    stored_as_sub_directories=False,
    table_name="tableName"
)

Attributes

bucket

(experimental) S3 bucket in which to store data.

Default:

one is created for you

Stability:

experimental

columns

(experimental) Columns of the table.

Stability:

experimental

compressed

(experimental) Indicates whether the table’s data is compressed or not.

Default:

false

Stability:

experimental

data_format

(experimental) Storage type of the table’s data.

Stability:

experimental

database

(experimental) Database in which to store the table.

Stability:

experimental

description

(experimental) Description of the table.

Default:

generated

Stability:

experimental

enable_partition_filtering

(experimental) Enables partition filtering.

Default:
  • The parameter is not defined

See:

https://docs.aws.amazon.com/athena/latest/ug/glue-best-practices.html#glue-best-practices-partition-index

Stability:

experimental

encryption

(experimental) The kind of encryption to secure the data with.

You can only provide this option if you are not explicitly passing in a bucket.

If you choose SSE-KMS, you can provide an un-managed KMS key with encryptionKey. If you choose CSE-KMS, you must provide an un-managed KMS key with encryptionKey.

Default:

BucketEncryption.S3_MANAGED

Stability:

experimental

encryption_key

(experimental) External KMS key to use for bucket encryption.

The encryption property must be SSE-KMS or CSE-KMS.

Default:

key is managed by KMS.

Stability:

experimental

parameters

(experimental) The key/value pairs define properties associated with the table.

The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.

Default:
  • The parameter is not defined

See:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-tableinput.html#cfn-glue-table-tableinput-parameters

Stability:

experimental

partition_indexes

(experimental) Partition indexes on the table.

A maximum of 3 indexes are allowed on a table. Keys in the index must be part of the table’s partition keys.

Default:

table has no partition indexes

Stability:

experimental

partition_keys

(experimental) Partition columns of the table.

Default:

table is not partitioned

Stability:

experimental

s3_prefix

(experimental) S3 prefix under which table objects are stored.

Default:
  • No prefix. The data will be stored under the root of the bucket.

Stability:

experimental

storage_parameters

(experimental) The user-supplied properties for the description of the physical storage of this table.

These properties help describe the format of the data that is stored within the crawled data sources.

The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.

Some keys will be auto-populated by glue crawlers, however, you can override them by specifying the key and value in this property.

Default:
  • The parameter is not defined

See:

https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under “TABLE PROPERTIES”

Stability:

experimental

Example:

# glue_database: glue.IDatabase

table = glue.Table(self, "Table",
    storage_parameters=[
        glue.StorageParameter.skip_header_line_count(1),
        glue.StorageParameter.compression_type(glue.CompressionType.GZIP),
        glue.StorageParameter.custom("foo", "bar"),  # Will have no effect
        glue.StorageParameter.custom("separatorChar", ","),  # Will describe the separator char used in the data
        glue.StorageParameter.custom(glue.StorageParameters.WRITE_PARALLEL, "off")
    ],
    # ...
    database=glue_database,
    columns=[glue.Column(
        name="col1",
        type=glue.Schema.STRING
    )],
    data_format=glue.DataFormat.CSV
)
stored_as_sub_directories

(experimental) Indicates whether the table data is stored in subdirectories.

Default:

false

Stability:

experimental

table_name

(experimental) Name of the table.

Default:
  • generated by CDK.

Stability:

experimental