DatePartitionProjectionConfigurationProps

class aws_cdk.aws_glue_alpha.DatePartitionProjectionConfigurationProps(*, format, max, min, interval=None, interval_unit=None)

Bases: object

(experimental) Properties for DATE partition projection configuration.

Parameters:
  • format (str) – (experimental) Date format for partition values. Uses Java SimpleDateFormat patterns.

  • max (str) – (experimental) End date for the partition range (inclusive). Can be either: - Fixed date in the format specified by format property - Relative date using NOW syntax Same format constraints as min.

  • min (str) – (experimental) Start date for the partition range (inclusive). Can be either: - Fixed date in the format specified by format property (e.g., ‘2020-01-01’ for format ‘yyyy-MM-dd’) - Relative date using NOW syntax (e.g., ‘NOW’, ‘NOW-3YEARS’, ‘NOW+1MONTH’)

  • interval (Union[int, float, None]) – (experimental) Interval between partition values. Required (together with intervalUnit) when format carries sub-day precision — i.e. a field finer than a day, such as hours or AM/PM. At day or coarser precision Athena defaults the step, so it is optional. Default: - Athena’s default step for the format’s precision; required when format is sub-day precision

  • interval_unit (Optional[DateIntervalUnit]) – (experimental) Unit for the interval. Required (together with interval) when format carries sub-day precision — i.e. a field finer than a day, such as hours or AM/PM. At day or coarser precision Athena defaults the step, so it is optional. Default: - Athena’s default unit for the format’s precision; required when format is sub-day precision

Stability:

experimental

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",
            interval=1,  # optional, defaults to 1
            interval_unit=glue.DateIntervalUnit.DAYS
        )
    }
)

Attributes

format

(experimental) Date format for partition values.

Uses Java SimpleDateFormat patterns.

See:

https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html

Stability:

experimental

interval

(experimental) Interval between partition values.

Required (together with intervalUnit) when format carries sub-day precision — i.e. a field finer than a day, such as hours or AM/PM. At day or coarser precision Athena defaults the step, so it is optional.

Default:
  • Athena’s default step for the format’s precision; required when format is sub-day precision

Stability:

experimental

interval_unit

(experimental) Unit for the interval.

Required (together with interval) when format carries sub-day precision — i.e. a field finer than a day, such as hours or AM/PM. At day or coarser precision Athena defaults the step, so it is optional.

Default:
  • Athena’s default unit for the format’s precision; required when format is sub-day precision

Stability:

experimental

max

(experimental) End date for the partition range (inclusive).

Can be either:

  • Fixed date in the format specified by format property

  • Relative date using NOW syntax

Same format constraints as min.

Stability:

experimental

min

(experimental) Start date for the partition range (inclusive).

Can be either:

  • Fixed date in the format specified by format property (e.g., ‘2020-01-01’ for format ‘yyyy-MM-dd’)

  • Relative date using NOW syntax (e.g., ‘NOW’, ‘NOW-3YEARS’, ‘NOW+1MONTH’)

See:

https://docs.aws.amazon.com/athena/latest/ug/partition-projection-supported-types.html#partition-projection-date-type

Stability:

experimental