TableBaseProps Struct
| Source | aws-glue/lib/table-base.ts |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_glue as glue } from 'aws-cdk-lib';
declare const database: glue.Database;
declare const dataFormat: glue.DataFormat;
declare const partitionProjectionConfiguration: glue.PartitionProjectionConfiguration;
declare const storageParameter: glue.StorageParameter;
declare const type: glue.Type;
const tableBaseProps: glue.TableBaseProps = {
columns: [{
name: 'name',
type: type,
// the properties below are optional
comment: 'comment',
}],
database: database,
dataFormat: dataFormat,
// the properties below are optional
compressed: false,
description: 'description',
enablePartitionFiltering: false,
hasEncryptedData: false,
parameters: {
parametersKey: 'parameters',
},
partitionIndexes: [{
keyNames: ['keyNames'],
// the properties below are optional
indexName: 'indexName',
}],
partitionKeys: [{
name: 'name',
type: type,
// the properties below are optional
comment: 'comment',
}],
partitionProjection: {
partitionProjectionKey: partitionProjectionConfiguration,
},
storageParameters: [storageParameter],
storedAsSubDirectories: false,
tableName: 'tableName',
};
# 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"
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.glue.*;
Database database;
DataFormat dataFormat;
PartitionProjectionConfiguration partitionProjectionConfiguration;
StorageParameter storageParameter;
Type type;
TableBaseProps tableBaseProps = TableBaseProps.builder()
.columns(List.of(Column.builder()
.name("name")
.type(type)
// the properties below are optional
.comment("comment")
.build()))
.database(database)
.dataFormat(dataFormat)
// the properties below are optional
.compressed(false)
.description("description")
.enablePartitionFiltering(false)
.hasEncryptedData(false)
.parameters(Map.of(
"parametersKey", "parameters"))
.partitionIndexes(List.of(PartitionIndex.builder()
.keyNames(List.of("keyNames"))
// the properties below are optional
.indexName("indexName")
.build()))
.partitionKeys(List.of(Column.builder()
.name("name")
.type(type)
// the properties below are optional
.comment("comment")
.build()))
.partitionProjection(Map.of(
"partitionProjectionKey", partitionProjectionConfiguration))
.storageParameters(List.of(storageParameter))
.storedAsSubDirectories(false)
.tableName("tableName")
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Glue;
Database database;
DataFormat dataFormat;
PartitionProjectionConfiguration partitionProjectionConfiguration;
StorageParameter storageParameter;
Type type;
var tableBaseProps = new TableBaseProps {
Columns = new [] { new Column {
Name = "name",
Type = type,
// the properties below are optional
Comment = "comment"
} },
Database = database,
DataFormat = dataFormat,
// the properties below are optional
Compressed = false,
Description = "description",
EnablePartitionFiltering = false,
HasEncryptedData = false,
Parameters = new Dictionary<string, string> {
{ "parametersKey", "parameters" }
},
PartitionIndexes = new [] { new PartitionIndex {
KeyNames = new [] { "keyNames" },
// the properties below are optional
IndexName = "indexName"
} },
PartitionKeys = new [] { new Column {
Name = "name",
Type = type,
// the properties below are optional
Comment = "comment"
} },
PartitionProjection = new Dictionary<string, PartitionProjectionConfiguration> {
{ "partitionProjectionKey", partitionProjectionConfiguration }
},
StorageParameters = new [] { storageParameter },
StoredAsSubDirectories = false,
TableName = "tableName"
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
var database Database
var dataFormat DataFormat
var partitionProjectionConfiguration PartitionProjectionConfiguration
var storageParameter StorageParameter
var type Type
tableBaseProps := &TableBaseProps{
Columns: []Column{
&Column{
Name: jsii.String("name"),
Type: type,
// the properties below are optional
Comment: jsii.String("comment"),
},
},
Database: database,
DataFormat: dataFormat,
// the properties below are optional
Compressed: jsii.Boolean(false),
Description: jsii.String("description"),
EnablePartitionFiltering: jsii.Boolean(false),
HasEncryptedData: jsii.Boolean(false),
Parameters: map[string]*string{
"parametersKey": jsii.String("parameters"),
},
PartitionIndexes: []PartitionIndex{
&PartitionIndex{
KeyNames: []*string{
jsii.String("keyNames"),
},
// the properties below are optional
IndexName: jsii.String("indexName"),
},
},
PartitionKeys: []Column{
&Column{
Name: jsii.String("name"),
Type: type,
// the properties below are optional
Comment: jsii.String("comment"),
},
},
PartitionProjection: map[string]PartitionProjectionConfiguration{
"partitionProjectionKey": partitionProjectionConfiguration,
},
StorageParameters: []StorageParameter{
storageParameter,
},
StoredAsSubDirectories: jsii.Boolean(false),
TableName: jsii.String("tableName"),
}
Properties
columnsColumn[]columnstyping.List[Column]columnsList<Column>ColumnsColumn[]Columns*[]Column required #compressedoptionalbooleancompressedoptionalboolcompressedoptionalBooleanCompressedoptionalboolCompressedoptional*bool = false #dataFormatDataFormatdata_formatDataFormatdataFormatDataFormatDataFormatDataFormatDataFormatDataFormat required #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.
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.