PartitionProjectionConfiguration

class aws_cdk.aws_glue_alpha.PartitionProjectionConfiguration(*args: Any, **kwargs)

Bases: object

(experimental) Factory class for creating partition projection configurations.

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

date_range

(experimental) Range of partition values for DATE type.

Array of [start, end] as date strings.

Stability:

experimental

digits

(experimental) Number of digits to pad INTEGER partition values.

Stability:

experimental

format

(experimental) Date format for DATE partition values (Java SimpleDateFormat).

Stability:

experimental

integer_range

(experimental) Range of partition values for INTEGER type.

Array of [min, max] as numbers.

Stability:

experimental

interval

(experimental) Interval between partition values.

Stability:

experimental

interval_unit

(experimental) Unit for DATE partition interval.

Stability:

experimental

type

(experimental) The type of partition projection.

Stability:

experimental

values

(experimental) Explicit list of values for ENUM partitions.

Stability:

experimental

Static Methods

classmethod date(*, format, max, min, interval=None, interval_unit=None)

(experimental) Create a 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. When the provided dates are at single-day or single-month precision, the interval is optional and defaults to 1 day or 1 month, respectively. Otherwise, interval is required. Default: - 1 for single-day or single-month precision, otherwise required

  • interval_unit (Optional[DateIntervalUnit]) – (experimental) Unit for the interval. When the provided dates are at single-day or single-month precision, the intervalUnit is optional and defaults to 1 day or 1 month, respectively. Otherwise, the intervalUnit is required. Default: - DAYS for single-day precision, MONTHS for single-month precision, otherwise required

Stability:

experimental

Return type:

PartitionProjectionConfiguration

classmethod enum(*, values)

(experimental) Create an ENUM partition projection configuration.

Parameters:

values (Sequence[str]) – (experimental) Explicit list of partition values.

Stability:

experimental

Return type:

PartitionProjectionConfiguration

classmethod injected()

(experimental) Create an INJECTED partition projection configuration.

Partition values are injected at query time through the query statement.

See:

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

Stability:

experimental

Return type:

PartitionProjectionConfiguration

classmethod integer(*, max, min, digits=None, interval=None)

(experimental) Create an INTEGER partition projection configuration.

Parameters:
  • max (Union[int, float]) – (experimental) Maximum value for the integer partition range (inclusive).

  • min (Union[int, float]) – (experimental) Minimum value for the integer partition range (inclusive).

  • digits (Union[int, float, None]) – (experimental) Number of digits to pad the partition value with leading zeros. With digits: 4, partition values: 0001, 0002, …, 0100 Default: - no static number of digits and no leading zeroes

  • interval (Union[int, float, None]) – (experimental) Interval between partition values. Default: 1

Stability:

experimental

Return type:

PartitionProjectionConfiguration