S3TableProps

class aws_cdk.aws_glue_alpha.S3TableProps(*, 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, client_side_encryption=None, s3_prefix=None, storage=None)

Bases: TableBaseProps

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

  • has_encrypted_data (Optional[bool]) – (experimental) 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]]) – (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

  • partition_projection (Optional[Mapping[str, PartitionProjectionConfiguration]]) – (experimental) 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]]) – (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.

  • client_side_encryption (Optional[TableClientSideEncryption]) – (experimental) Client-side encryption (CSE-KMS) for the table’s data. Independent of the bucket’s server-side encryption, and valid whether the bucket is managed or provided. Default: - no client-side encryption

  • s3_prefix (Optional[str]) – (experimental) S3 prefix under which table objects are stored. When the table shares a bucket with other tables or consumers, set this so that the grant* methods scope S3 access to this table’s data. Without a prefix, those grants cover the entire bucket. Default: - No prefix. The data will be stored under the root of the bucket.

  • storage (Optional[S3TableStorage]) – (experimental) Where the table’s data is stored: a bucket created and managed by the table, or an existing bucket you provide. Default: - a managed bucket with S3-managed (SSE-S3) encryption

Stability:

experimental

ExampleMetadata:

infused

Example:

# my_database: glue.Database

glue.S3Table(self, "MyTable",
    database=my_database,
    columns=[glue.Column(
        name="data",
        type=glue.Schema.STRING
    )],
    partition_keys=[glue.Column(
        name="date",
        type=glue.Schema.STRING
    )],
    data_format=glue.DataFormat.JSON,
    partition_projection={
        "date": glue.PartitionProjectionConfiguration.date(
            min="NOW-3YEARS",
            max="NOW",
            format="yyyy-MM-dd"
        )
    }
)

Attributes

client_side_encryption

(experimental) Client-side encryption (CSE-KMS) for the table’s data.

Independent of the bucket’s server-side encryption, and valid whether the bucket is managed or provided.

Default:
  • no client-side encryption

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

has_encrypted_data

(experimental) 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

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

partition_projection

(experimental) 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

Stability:

experimental

s3_prefix

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

When the table shares a bucket with other tables or consumers, set this so that the grant* methods scope S3 access to this table’s data. Without a prefix, those grants cover the entire bucket.

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

Stability:

experimental

storage

a bucket created and managed by the table, or an existing bucket you provide.

Default:
  • a managed bucket with S3-managed (SSE-S3) encryption

Stability:

experimental

Type:

(experimental) Where the table’s data is stored

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.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

(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