paimon icon indicating copy to clipboard operation
paimon copied to clipboard

[Bug] expire_partitions procedure fails on DATE type partition columns

Open tony-ps-lin-appier opened this issue 2 months ago • 0 comments

Search before asking

  • [x] 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!

tony-ps-lin-appier avatar Oct 21 '25 02:10 tony-ps-lin-appier