Skip to content

Conversation

@geruh
Copy link
Contributor

@geruh geruh commented Nov 25, 2025

related to #2775

Rationale for this change

This PR aligns the AlwaysTrue and AlwaysFalse expression serialization to use the boolean primitives true/false instead of string representation, matching the Iceberg ExpressionParser.

I know the spec defines the true/false expressions as string but today we can't hit the scan planning client endpoint following these models.

I know the spec defines the true/false expressions as a string representation, but currently we can't successfully use the scan planning client endpoint with those models. Java's actual implementation serializes these as boolean literals.

For instance, with what we have today we would throw an illegal argument exception:

{
    "snapshot-id": 2540284336700708540,
    "filter": "true",
    "case-sensitive": true
}

Throws: java.lang.IllegalArgumentException: argument "content" is null

But, this works just fine (notice no quotes):

{
    "snapshot-id": 2540284336700708540,
    "filter": true,
    "case-sensitive": true
}

Are these changes tested?

Yes

Are there any user-facing changes?

No, this only affects the JSON serialization format to match Java Cores behavior.

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevinjqliu kevinjqliu merged commit d9bdf8e into apache:main Nov 25, 2025
8 checks passed
@kevinjqliu
Copy link
Contributor

Only json boolean is allowed, not string "true". This is gated by the pNode.isBoolean() precondition here:
https://github.com/apache/iceberg/blob/a3c538f647a113cf61dbfd7855d9c71da8c722ba/core/src/main/java/org/apache/iceberg/util/JsonUtil.java#L162-L167

@kevinjqliu
Copy link
Contributor

Corresponding PR to fix in the REST spec, apache/iceberg#14677

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants