TableBaseProps

class aws_cdk.aws_glue.TableBaseProps(*, columns, database, data_format, compressed=None, description=None, enable_partition_filtering=None, has_encrypted_data=None, parameters=None, partition_indexes=None, partition_keys=None, partition_projection=None, storage_parameters=None, stored_as_sub_directories=None, table_name=None)

Bases: object

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

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

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

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

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

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

  • has_encrypted_data (Optional[bool]) – Whether the data stored in the table is encrypted. This sets the has_encrypted_data table parameter. Athena reads it when querying client-side (CSE-KMS) encrypted datasets; for server-side encrypted (SSE-S3 / SSE-KMS) or unencrypted data it has no effect, since Amazon S3 decrypts server-side encrypted objects transparently. Do not also set has_encrypted_data through parameters - use this property instead. A conflicting value in parameters is rejected. Default: true

  • parameters (Optional[Mapping[str, str]]) – 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]]]]) – 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]]]]) – Partition columns of the table. Default: table is not partitioned

  • partition_projection (Optional[Mapping[str, PartitionProjectionConfiguration]]) – Partition projection configuration for this table. Partition projection allows Athena to automatically add new partitions without requiring ALTER TABLE ADD PARTITION statements. Default: - No partition projection

  • storage_parameters (Optional[Sequence[StorageParameter]]) – 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]) – Indicates whether the table data is stored in subdirectories. Default: false

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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_glue as glue

# database: glue.Database
# data_format: glue.DataFormat
# partition_projection_configuration: glue.PartitionProjectionConfiguration
# storage_parameter: glue.StorageParameter
# type: glue.Type

table_base_props = glue.TableBaseProps(
    columns=[glue.Column(
        name="name",
        type=type,

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

    # the properties below are optional
    compressed=False,
    description="description",
    enable_partition_filtering=False,
    has_encrypted_data=False,
    parameters={
        "parameters_key": "parameters"
    },
    partition_indexes=[glue.PartitionIndex(
        key_names=["keyNames"],

        # the properties below are optional
        index_name="indexName"
    )],
    partition_keys=[glue.Column(
        name="name",
        type=type,

        # the properties below are optional
        comment="comment"
    )],
    partition_projection={
        "partition_projection_key": partition_projection_configuration
    },
    storage_parameters=[storage_parameter],
    stored_as_sub_directories=False,
    table_name="tableName"
)

Attributes

columns

Columns of the table.

compressed

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

Default:

false

data_format

Storage type of the table’s data.

database

Database in which to store the table.

description

Description of the table.

Default:

generated

enable_partition_filtering

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

has_encrypted_data

Whether the data stored in the table is encrypted.

This sets the has_encrypted_data table parameter. Athena reads it when querying client-side (CSE-KMS) encrypted datasets; for server-side encrypted (SSE-S3 / SSE-KMS) or unencrypted data it has no effect, since Amazon S3 decrypts server-side encrypted objects transparently.

Do not also set has_encrypted_data through parameters - use this property instead. A conflicting value in parameters is rejected.

Default:

true

See:

https://docs.aws.amazon.com/athena/latest/ug/creating-tables-based-on-encrypted-datasets-in-s3.html

parameters

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

partition_indexes

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

Partition columns of the table.

Default:

table is not partitioned

partition_projection

Partition projection configuration for this table.

Partition projection allows Athena to automatically add new partitions without requiring ALTER TABLE ADD PARTITION statements.

Default:
  • No partition projection

See:

https://docs.aws.amazon.com/athena/latest/ug/partition-projection.html

storage_parameters

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”

Example:

# glue_database: glue.IDatabase

table = glue.S3Table(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

Indicates whether the table data is stored in subdirectories.

Default:

false

table_name

Name of the table.

Default:
  • generated by CDK.