DatePartitionProjectionConfigurationProps
- class aws_cdk.aws_glue.DatePartitionProjectionConfigurationProps(*, format, max, min, step=None)
Bases:
objectProperties for DATE partition projection configuration.
- Parameters:
format (
str) – Date format for partition values. Uses Java SimpleDateFormat patterns.max (
str) – End date for the partition range (inclusive). Can be either: - Fixed date in the format specified byformatproperty - Relative date using NOW syntax Same format constraints asmin.min (
str) – Start date for the partition range (inclusive). Can be either: - Fixed date in the format specified byformatproperty (e.g., ‘2020-01-01’ for format ‘yyyy-MM-dd’) - Relative date using NOW syntax (e.g., ‘NOW’, ‘NOW-3YEARS’, ‘NOW+1MONTH’)step (
Union[DateProjectionStep,Dict[str,Any],None]) – Interval step (interval+intervalUnit) between partition values. The two are supplied together, so a partial step cannot be expressed. Required whenformatcarries sub-day precision — a field finer than a day, such as hours or AM/PM; at day or coarser precision Athena defaults the step, so it may be omitted. Default: - Athena’s default step for the format’s precision; required whenformatis sub-day precision
- ExampleMetadata:
infused
Example:
# 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="date", type=glue.Schema.STRING )], data_format=glue.DataFormat.JSON, partition_projection={ "date": glue.PartitionProjectionConfiguration.date( min="2020-01-01", max="2023-12-31", format="yyyy-MM-dd", # `step` bundles interval + unit (supply both or neither). Optional at day # precision or coarser; required when the format is sub-day (e.g. hours). step=glue.DateProjectionStep(interval=1, interval_unit=glue.DateIntervalUnit.DAYS) ) } )
Attributes
- format
Date format for partition values.
Uses Java SimpleDateFormat patterns.
- max
End date for the partition range (inclusive).
Can be either:
Fixed date in the format specified by
formatpropertyRelative date using NOW syntax
Same format constraints as
min.
- min
Start date for the partition range (inclusive).
Can be either:
Fixed date in the format specified by
formatproperty (e.g., ‘2020-01-01’ for format ‘yyyy-MM-dd’)Relative date using NOW syntax (e.g., ‘NOW’, ‘NOW-3YEARS’, ‘NOW+1MONTH’)
- step
Interval step (
interval+intervalUnit) between partition values.The two are supplied together, so a partial step cannot be expressed. Required when
formatcarries sub-day precision — a field finer than a day, such as hours or AM/PM; at day or coarser precision Athena defaults the step, so it may be omitted.- Default:
Athena’s default step for the format’s precision; required when
formatis sub-day precision