ExternalTableProps
- class aws_cdk.aws_glue.ExternalTableProps(*, 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, connection, external_data_location)
Bases:
TableBaseProps- 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: falsedescription (
Optional[str]) – Description of the table. Default: generatedenable_partition_filtering (
Optional[bool]) – Enables partition filtering. Default: - The parameter is not definedhas_encrypted_data (
Optional[bool]) – Whether the data stored in the table is encrypted. This sets thehas_encrypted_datatable 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 sethas_encrypted_datathroughparameters- use this property instead. A conflicting value inparametersis rejected. Default: trueparameters (
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 definedpartition_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 indexespartition_keys (
Optional[Sequence[Union[Column,Dict[str,Any]]]]) – Partition columns of the table. Default: table is not partitionedpartition_projection (
Optional[Mapping[str,PartitionProjectionConfiguration]]) – Partition projection configuration for this table. Partition projection allows Athena to automatically add new partitions without requiringALTER TABLE ADD PARTITIONstatements. Default: - No partition projectionstorage_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 definedstored_as_sub_directories (
Optional[bool]) – Indicates whether the table data is stored in subdirectories. Default: falsetable_name (
Optional[str]) – Name of the table. Default: - generated by CDK.connection (
IConnection) – The connection the table will use when performing reads and writes.external_data_location (
str) – The data source location of the glue table, (e.g.default_db_public_examplefor Redshift). This overrides bothbucketands3Prefix.
- ExampleMetadata:
infused
Example:
# my_connection: glue.Connection # my_database: glue.Database glue.ExternalTable(self, "MyTable", connection=my_connection, external_data_location="default_db_public_example", # A table in Redshift # ... database=my_database, columns=[glue.Column( name="col1", type=glue.Schema.STRING )], data_format=glue.DataFormat.JSON )
Attributes
- columns
Columns of the table.
- compressed
Indicates whether the table’s data is compressed or not.
- Default:
false
- connection
The connection the table will use when performing reads and writes.
- 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:
- external_data_location
The data source location of the glue table, (e.g.
default_db_public_examplefor Redshift).This overrides both
bucketands3Prefix.
- has_encrypted_data
Whether the data stored in the table is encrypted.
This sets the
has_encrypted_datatable 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_datathroughparameters- use this property instead. A conflicting value inparametersis rejected.
- 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:
- 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 PARTITIONstatements.- 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.