Skip to content

[Bug] expire_partitions procedure fails on DATE type partition columns #6439

@tony-ps-lin-appier

Description

@tony-ps-lin-appier

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

1.2.0

Compute Engine

spark 3.5

Minimal reproduce step

  1. create table
CREATE TABLE .main.test (
    order_id          STRING,
    order_price       DOUBLE,
    order_date        DATE
)
USING paimon
PARTITIONED BY (order_date)
TBLPROPERTIES (
  'bucket-key' = 'order_id',
  'bucket' = '16',
  'primary-key' = 'order_date,order_id',
  'deletion-vectors.enabled' = 'true'
);
  1. insert some record
INSERT INTO main.test VALUES ('order_001', 1.0, '2025-10-10')
  1. try to use expire_partitions
CALL sys.expire_partitions(
    table => 'main.test', 
    expiration_time => '1 d',
    timestamp_formatter => 'yyyy-MM-dd',
    timestamp_pattern => '$order_date',
    expire_strategy => 'values-time'
)

What doesn't meet your expectations?

Result will be No expired partitions.

WARN PartitionValuesTimeExpireStrategy: Can't extract datetime from partition order_date:20371.

But I think the expire_partitions procedure should be type-aware. It should correctly interpret the value of a DATE partition column and compare it with the expiration time.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions