IntegerPartitionProjectionConfigurationProps Struct
Properties for INTEGER partition projection configuration.
| Source | aws-glue/lib/partition-projection.ts |
|---|---|
| Type last changed |
Example
ts
declare const myDatabase: glue.Database;
new glue.S3Table(this, 'MyTable', {
database: myDatabase,
columns: [{
name: 'data',
type: glue.Schema.STRING,
}],
partitionKeys: [{
name: 'year',
type: glue.Schema.INTEGER,
}],
dataFormat: glue.DataFormat.JSON,
partitionProjection: {
year: glue.PartitionProjectionConfiguration.integer({
min: 2020,
max: 2023,
interval: 1, // optional, defaults to 1
digits: 4, // optional, pads with leading zeros
}),
},
});
python
# 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="year",
type=glue.Schema.INTEGER
)],
data_format=glue.DataFormat.JSON,
partition_projection={
"year": glue.PartitionProjectionConfiguration.integer(
min=2020,
max=2023,
interval=1, # optional, defaults to 1
digits=4
)
}
)
java
Database myDatabase;
S3Table.Builder.create(this, "MyTable")
.database(myDatabase)
.columns(List.of(Column.builder()
.name("data")
.type(Schema.STRING)
.build()))
.partitionKeys(List.of(Column.builder()
.name("year")
.type(Schema.INTEGER)
.build()))
.dataFormat(DataFormat.JSON)
.partitionProjection(Map.of(
"year", PartitionProjectionConfiguration.integer(IntegerPartitionProjectionConfigurationProps.builder()
.min(2020)
.max(2023)
.interval(1) // optional, defaults to 1
.digits(4)
.build())))
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
Database myDatabase;
new S3Table(this, "MyTable", new S3TableProps {
Database = myDatabase,
Columns = new [] { new Column {
Name = "data",
Type = Schema.STRING
} },
PartitionKeys = new [] { new Column {
Name = "year",
Type = Schema.INTEGER
} },
DataFormat = DataFormat.JSON,
PartitionProjection = new Dictionary<string, PartitionProjectionConfiguration> {
{ "year", PartitionProjectionConfiguration.Integer(new IntegerPartitionProjectionConfigurationProps {
Min = 2020,
Max = 2023,
Interval = 1, // optional, defaults to 1
Digits = 4
}) }
}
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var myDatabase Database
glue.NewS3Table(this, jsii.String("MyTable"), &S3TableProps{
Database: myDatabase,
Columns: []Column{
&Column{
Name: jsii.String("data"),
Type: glue.Schema_STRING(),
},
},
PartitionKeys: []Column{
&Column{
Name: jsii.String("year"),
Type: glue.Schema_INTEGER(),
},
},
DataFormat: glue.DataFormat_JSON(),
PartitionProjection: map[string]PartitionProjectionConfiguration{
"year": glue.PartitionProjectionConfiguration_integer(&IntegerPartitionProjectionConfigurationProps{
"min": jsii.Number(2020),
"max": jsii.Number(2023),
"interval": jsii.Number(1),
// optional, defaults to 1
"digits": jsii.Number(4),
}),
},
})
Properties
digitsoptionalnumberdigitsoptionalint | floatdigitsoptionalNumberDigitsoptionaldoubleDigitsoptional*float64 #Number of digits to pad the partition value with leading zeros.
Default: no static number of digits and no leading zeroes
With digits: 4, partition values: 0001, 0002, ..., 0100
intervaloptionalnumberintervaloptionalint | floatintervaloptionalNumberIntervaloptionaldoubleIntervaloptional*float64 = 1 #Interval between partition values.
Maximum value for the integer partition range (inclusive).
Minimum value for the integer partition range (inclusive).