huaxingao commented on code in PR #17138:
URL: https://github.com/apache/iceberg/pull/17138#discussion_r3564849728
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -2606,7 +2630,206 @@ components:
child:
$ref: '#/components/schemas/Expression'
+ UnaryPredicate:
+ description: >
+ A predicate that tests a single value expression.
+ type: object
Review Comment:
Should we add `additionalProperties: false` to `UnaryPredicate`,
`ComparisonPredicate`, and `SetPredicate`? The new value schemas (`Literal`,
`FieldReference*`, `Apply`) already have it.
Right now these predicates allow extra fields. So an object that has both a
new field (child) and an old field (term) would match both the new predicate
and the old deprecated one. Since `Expression` uses `oneOf`, matching two
schemas at once is an error. Adding `additionalProperties: false` makes each
schema reject fields it doesn't expect, so only one can match.
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -2606,7 +2630,206 @@ components:
child:
$ref: '#/components/schemas/Expression'
+ UnaryPredicate:
+ description: >
+ A predicate that tests a single value expression.
+ type: object
+ required:
+ - type
+ - child
+ properties:
+ type:
+ $ref: '#/components/schemas/ExpressionType'
+ enum: ["is-null", "not-null", "is-nan", "not-nan"]
+ child:
+ $ref: '#/components/schemas/ValueExpression'
+
+ ComparisonPredicate:
+ description: >
+ A predicate that compares two value expressions.
+ type: object
+ required:
+ - type
+ - left
+ - right
+ properties:
+ type:
+ $ref: '#/components/schemas/ExpressionType'
+ enum: ["lt", "lt-eq", "gt", "gt-eq", "eq", "not-eq", "starts-with",
"not-starts-with"]
+ left:
+ $ref: '#/components/schemas/ValueExpression'
+ right:
+ $ref: '#/components/schemas/ValueExpression'
+
+ SetPredicate:
+ description: >
+ A predicate that operates on a list of literals.
+ type: object
+ required:
+ - type
+ - child
+ - values
+ properties:
+ type:
+ $ref: '#/components/schemas/ExpressionType'
+ enum: ["in", "not-in"]
+ child:
+ $ref: '#/components/schemas/ValueExpression'
+ values:
+ $ref: '#/components/schemas/Literals'
+
+ Literal:
+ description: >
+ A literal value expression. Three JSON forms are accepted: a bare
+ scalar value, a typed literal object without a data-type, or a
+ typed literal object with an explicit data-type.
+ oneOf:
+ - type: string
+ - type: number
+ - type: boolean
Review Comment:
The bare-value branch uses `string` | `number` | `boolean` while the
typed-object branch reuses `PrimitiveTypeValue` for value , is the split
intentional?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]