interface S3TableProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Glue.Alpha.S3TableProps |
Go | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#S3TableProps |
Java | software.amazon.awscdk.services.glue.alpha.S3TableProps |
Python | aws_cdk.aws_glue_alpha.S3TableProps |
TypeScript (source) | @aws-cdk/aws-glue-alpha ยป S3TableProps |
Example
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
database: myDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
partitionKeys: [{
name: 'year',
type: glue.Schema.SMALL_INT,
}, {
name: 'month',
type: glue.Schema.SMALL_INT,
}],
dataFormat: glue.DataFormat.JSON,
enablePartitionFiltering: true,
});
Properties
Name | Type | Description |
---|---|---|
columns | Column [] | Columns of the table. |
data | Data | Storage type of the table's data. |
database | IDatabase | Database in which to store the table. |
bucket? | IBucket | S3 bucket in which to store data. |
compressed? | boolean | Indicates whether the table's data is compressed or not. |
description? | string | Description of the table. |
enable | boolean | Enables partition filtering. |
encryption? | Table | The kind of encryption to secure the data with. |
encryption | IKey | External KMS key to use for bucket encryption. |
parameters? | { [string]: string } | The key/value pairs define properties associated with the table. |
partition | Partition [] | Partition indexes on the table. |
partition | Column [] | Partition columns of the table. |
s3 | string | S3 prefix under which table objects are stored. |
storage | Storage [] | The user-supplied properties for the description of the physical storage of this table. |
stored | boolean | Indicates whether the table data is stored in subdirectories. |
table | string | Name of the table. |
columns
Type:
Column
[]
Columns of the table.
dataFormat
Type:
Data
Storage type of the table's data.
database
Type:
IDatabase
Database in which to store the table.
bucket?
Type:
IBucket
(optional, default: one is created for you)
S3 bucket in which to store data.
compressed?
Type:
boolean
(optional, default: false)
Indicates whether the table's data is compressed or not.
description?
Type:
string
(optional, default: generated)
Description of the table.
enablePartitionFiltering?
Type:
boolean
(optional, default: The parameter is not defined)
Enables partition filtering.
encryption?
Type:
Table
(optional, default: BucketEncryption.S3_MANAGED)
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
.
encryptionKey?
Type:
IKey
(optional, default: key is managed by KMS.)
External KMS key to use for bucket encryption.
The encryption
property must be SSE-KMS
or CSE-KMS
.
parameters?
Type:
{ [string]: string }
(optional, default: The parameter is not defined)
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.
partitionIndexes?
Type:
Partition
[]
(optional, default: table has no 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.
partitionKeys?
Type:
Column
[]
(optional, default: table is not partitioned)
Partition columns of the table.
s3Prefix?
Type:
string
(optional, default: No prefix. The data will be stored under the root of the bucket.)
S3 prefix under which table objects are stored.
storageParameters?
Type:
Storage
[]
(optional, default: The parameter is not defined)
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.
See also: [https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under "TABLE PROPERTIES"](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under "TABLE PROPERTIES") Example
declare const glueDatabase: glue.IDatabase;
const table = new glue.Table(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,
});
storedAsSubDirectories?
Type:
boolean
(optional, default: false)
Indicates whether the table data is stored in subdirectories.
tableName?
Type:
string
(optional, default: generated by CDK.)
Name of the table.