S3TableProps Struct
Example
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
database: myDatabase,
columns: [{
name: 'data',
type: glue.Schema.STRING,
}],
partitionKeys: [{
name: 'date',
type: glue.Schema.STRING,
}],
dataFormat: glue.DataFormat.JSON,
partitionProjection: {
date: glue.PartitionProjectionConfiguration.date({
min: 'NOW-3YEARS',
max: 'NOW',
format: 'yyyy-MM-dd',
}),
},
});
Properties
clientSideEncryptionoptionalTableClientSideEncryptionclient_side_encryptionoptionalTableClientSideEncryptionclientSideEncryptionoptionalTableClientSideEncryptionClientSideEncryptionoptionalTableClientSideEncryptionClientSideEncryptionoptionalTableClientSideEncryption#Default: no client-side encryption
Independent of the bucket's server-side encryption, and valid whether the bucket is managed or provided.
columnsColumn[]columnstyping.List[Column]columnsList<Column>ColumnsColumn[]Columns*[]Columnrequired#compressedoptionalbooleancompressedoptionalboolcompressedoptionalBooleanCompressedoptionalboolCompressedoptional*bool= false#dataFormatDataFormatdata_formatDataFormatdataFormatDataFormatDataFormatDataFormatDataFormatDataFormatrequired#descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string= generated#enablePartitionFilteringoptionalbooleanenable_partition_filteringoptionalboolenablePartitionFilteringoptionalBooleanEnablePartitionFilteringoptionalboolEnablePartitionFilteringoptional*bool#Default: The parameter is not defined
hasEncryptedDataoptionalbooleanhas_encrypted_dataoptionalboolhasEncryptedDataoptionalBooleanHasEncryptedDataoptionalboolHasEncryptedDataoptional*bool= true#notes
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.
parametersoptional{ [key: string]: string }parametersoptionaltyping.Mapping[str, str]parametersoptionalMap<String, String>ParametersoptionalIDictionary<string, string>Parametersoptional*map[string]*string#Default: The parameter is not defined
The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.
partitionIndexesoptionalPartitionIndex[]partition_indexesoptionaltyping.List[PartitionIndex]partitionIndexesoptionalList<PartitionIndex>PartitionIndexesoptionalPartitionIndex[]PartitionIndexesoptional*[]PartitionIndex#Default: table has no partition indexes
A maximum of 3 indexes are allowed on a table. Keys in the index must be part of the table's partition keys.
partitionKeysoptionalColumn[]partition_keysoptionaltyping.List[Column]partitionKeysoptionalList<Column>PartitionKeysoptionalColumn[]PartitionKeysoptional*[]Column#Default: table is not partitioned
partitionProjectionoptional{ [key: string]: PartitionProjectionConfiguration }partition_projectionoptionaltyping.Mapping[str, PartitionProjectionConfiguration]partitionProjectionoptionalMap<String, PartitionProjectionConfiguration>PartitionProjectionoptionalIDictionary<string, PartitionProjectionConfiguration>PartitionProjectionoptional*map[string]PartitionProjectionConfiguration#Default: No partition projection
Partition projection allows Athena to automatically add new partitions without requiring ALTER TABLE ADD PARTITION statements.
s3Prefixoptionalstrings3_prefixoptionalstrs3PrefixoptionalStringS3PrefixoptionalstringS3Prefixoptional*string#Default: No prefix. The data will be stored under the root of the bucket.
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.
storageoptionalS3TableStoragestorageoptionalS3TableStoragestorageoptionalS3TableStorageStorageoptionalS3TableStorageStorageoptionalS3TableStorage#Default: a managed bucket with S3-managed (SSE-S3) encryption
storageParametersoptionalStorageParameter[]storage_parametersoptionaltyping.List[StorageParameter]storageParametersoptionalList<StorageParameter>StorageParametersoptionalStorageParameter[]StorageParametersoptional*[]StorageParameter#Default: The parameter is not defined
notes · example
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.
declare const glueDatabase: glue.IDatabase;
const table = new glue.S3Table(this, 'Table', {
storageParameters: [
glue.StorageParameter.skipHeaderLineCount(1),
glue.StorageParameter.compressionType(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: glueDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
dataFormat: glue.DataFormat.CSV,
});
storedAsSubDirectoriesoptionalbooleanstored_as_sub_directoriesoptionalboolstoredAsSubDirectoriesoptionalBooleanStoredAsSubDirectoriesoptionalboolStoredAsSubDirectoriesoptional*bool= false#tableNameoptionalstringtable_nameoptionalstrtableNameoptionalStringTableNameoptionalstringTableNameoptional*string#Default: generated by CDK.