Skip to content

[Bug] DATE, TIME, TIMESTAMP and DECIMAL predicate literals cannot survive predicate JSON #9639

Description

@LuciferYang

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

master, 475be566f (2.1-SNAPSHOT).

Compute Engine

Any engine using a REST catalog. Both ends of this JSON are in paimon-core: RESTCatalog.listPartitionsByFilterPaged serializes a predicate into ListPartitionsByFilterRequest.filter, and TableQueryAuthResult.parsePredicate reads the row-level filter out of AuthTableQueryResponse.filter on every scan.

Minimal reproduce step

Round-trip a predicate whose literal is a DATE, TIME, TIMESTAMP, TIMESTAMP_LTZ or DECIMAL through the predicate JSON:

Predicate p = builder.equal(0, DateTimeUtils.toInternal(LocalDate.of(2026, 1, 15)));
JsonSerdeUtil.fromJson(JsonSerdeUtil.toFlatJson(p), Predicate.class);
// java.lang.UnsupportedOperationException: Unexpected date literal of class java.util.ArrayList

JsonSerdeUtil registers Jackson's JavaTimeModule and does not disable WRITE_DATES_AS_TIMESTAMPS, so LeafPredicate.serializeLiterals hands it a LocalDate and it comes out as [2026,1,15]; a BigDecimal comes out as a JSON number. Reading back gives an ArrayList and a Double, and PredicateBuilder.convertJavaObject accepts neither:

case DATE:
    if (o instanceof java.sql.Date) { ... }
    else if (o instanceof java.sql.Timestamp) { ... }
    else if (o instanceof LocalDate) { ... }
    else { throw new UnsupportedOperationException("Unexpected date literal of class " + o.getClass()); }

DECIMAL is a (BigDecimal) o cast, so that one is a ClassCastException.

So a partition filter on a DATE column, or a row-level filter carrying a DECIMAL, fails as soon as it crosses the REST boundary. There is no shape that works: the writer's own output is what the reader rejects.

What doesn't meet your expectations?

A predicate should survive its own serialization. These five types have no working representation at all today, which is why nothing depends on the current one.

Anything else?

PredicateJsonSerdeTest covers BIGINT, STRING and ARRAY literals, so none of the affected types were exercised.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions