API: Fix misleading error message in predicate()#16872
Open
thswlsqls wants to merge 2 commits into
Open
Conversation
The Preconditions check in predicate(Operation, String, Literal) rejected unary operations (IS_NULL, NOT_NULL, IS_NAN, NOT_NAN) that take no value with the message "Cannot create %s predicate inclusive a value", which is not grammatical. Change it to "with a value" so it mirrors the sibling method predicate(Operation, String), which rejects value-taking operations with "without a value". Generated-by: Claude Code
ebyhr
reviewed
Jun 19, 2026
Per review feedback, move testPredicateWithValueForUnaryOperation from TestExpressionHelpers to TestExpressionUtil, where the predicate() factory is exercised. The assertion is unchanged. Generated-by: Claude Code
wombatu-kun
approved these changes
Jun 20, 2026
ebyhr
approved these changes
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expressions.predicate(Operation, String, Literal)rejects the unary operations IS_NULL, NOT_NULL, IS_NAN, NOT_NAN (which take no value) with the messageCannot create %s predicate inclusive a value.inclusive a valueis not grammatical and does not describe the failure.predicate(Operation, String)rejects value-taking operations withCannot create %s predicate without a value. This is the mirror case — a value passed to a unary op — so the message should readwith a value.Cannot create %s predicate with a value. No signature, branch, or ABI change.Testing done
TestExpressionHelpers#testPredicateWithValueForUnaryOperationassertingpredicate(IS_NULL, "x", 5)throwsIllegalArgumentExceptionwith messageCannot create IS_NULL predicate with a value../gradlew :iceberg-api:check— passed (TestExpressionHelpers: 14 tests, 0 failures; includes spotlessCheck, checkstyle, errorProne)../gradlew :iceberg-api:revapi— passed (backward compatible; only an error-message string changed).AI Disclosure