You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "LuciferYang (via GitHub)" <gi...@apache.org> on 2026/09/05 08:31:14 UTC
[PR] [common] Fix JSON round-trip of temporal and decimal predicate literals [paimon]
LuciferYang opened a new pull request, #9640:
URL: https://github.com/apache/paimon/pull/9640
### Purpose
close #9639
`LeafPredicate` handed its literals to Jackson as whatever `PredicateBuilder.convertToJavaObject` produced. `JsonSerdeUtil` registers `JavaTimeModule` without disabling `WRITE_DATES_AS_TIMESTAMPS`, so a `LocalDate` was written as `[2026,1,15]` and a `BigDecimal` as a JSON number; reading those back yields an `ArrayList` and a `Double`, and `PredicateBuilder.convertJavaObject` rejects both. DATE, TIME, TIMESTAMP, TIMESTAMP_LTZ and DECIMAL literals therefore could not round-trip at all: the writer's output is exactly what the reader refuses.
Those five now go out as strings, ISO-8601 for the temporal types and `toPlainString` for decimals, and come back through the matching parse before `convertJavaObject` sees them. Everything else is untouched.
This changes the wire representation of those literals. Nothing that worked before breaks, because reading them back never worked; but a non-Paimon REST server that parses the filter JSON itself would see a string where it previously saw an array or a number, so it is worth calling out in release notes.
The reader deliberately does not also accept the old array and number forms. I had that in an earlier version and dropped it: those shapes have never been readable, so there is no stored or in-flight predicate in that form that used to work, and reconstructing them means guessing at things like which trailing fields Jackson omitted and how much precision a double kept. If a concrete compatibility case turns up, that is worth adding on its own terms.
### Tests
`PredicateJsonSerdeTest.testTemporalAndDecimalLiteralsRoundTrip` builds a predicate over a row with all five affected types, including a DECIMAL(20,3) with more significant digits than a double can hold, serializes it and asserts the parsed predicate equals the original.
Against the unfixed code it fails with `UnsupportedOperationException: Unexpected date literal of class java.util.ArrayList`.
`mvn -pl paimon-common -Dtest=PredicateJsonSerdeTest test` on JDK 8: 91 tests, 0 failures. `spotless:check` and `checkstyle:check` on paimon-common are clean.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [common] Fix JSON round-trip of temporal and decimal predicate literals [paimon]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #9640:
URL: https://github.com/apache/paimon/pull/9640#issuecomment-5646328927
Updated the description to cover the open point. It now spells out the rollout order (a REST server has to understand the new string encoding before an upgraded client emits it, so deploy the server-side parser first and call it out in the release notes) and scopes the "nothing breaks" claim to Paimon's own Java reader, without asserting how independent servers treated the old array/number forms.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [common] Fix JSON round-trip of temporal and decimal predicate literals [paimon]
Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #9640:
URL: https://github.com/apache/paimon/pull/9640#issuecomment-5658327386
Thank you @JingsongLi
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [common] Fix JSON round-trip of temporal and decimal predicate literals [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #9640:
URL: https://github.com/apache/paimon/pull/9640
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org