zhjwpku commented on code in PR #17138:
URL: https://github.com/apache/iceberg/pull/17138#discussion_r3642945198


##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -2604,63 +2619,216 @@ components:
           $ref: '#/components/schemas/ExpressionType'
           const: "not"
         child:
-          $ref: '#/components/schemas/Expression'
+          $ref: '#/components/schemas/Predicate'
 
-    UnaryExpression:
+    UnaryPredicate:
+      description: >
+        A predicate that tests a single value expression. Accepts either
+        'child' (preferred) or 'term' (deprecated) to identify the operand.
       type: object
+      additionalProperties: false
       required:
         - type
-        - term
       properties:
         type:
           $ref: '#/components/schemas/ExpressionType'
           enum: ["is-null", "not-null", "is-nan", "not-nan"]
+        child:
+          $ref: '#/components/schemas/ValueExpression'
         term:
+          deprecated: true
+          description: "Deprecated. Use 'child' instead."
           $ref: '#/components/schemas/Term'
 
-    LiteralExpression:
+    ComparisonPredicate:
+      description: >
+        A predicate that compares two value expressions. Accepts either
+        'left'/'right' (preferred) or 'term'/'value' (deprecated).
       type: object
+      additionalProperties: false
       required:

Review Comment:
   This currently allows predicates with missing operands, for example:
   
   ```json
   {"type": "eq"}
   ```
   
   It also allows partially specified or mixed representations, such as `left` 
with `term/value`.
   
   ```
   {
     "type": "eq",
     "left": {"type": "reference", "name": "a"},
     "term": "b",
     "value": 1
   }
   ```
   
   According to the expressions spec, the current form must contain both `left` 
and `right`, while the deprecated form must contain both `term` and `value`. 
Could we model the current and deprecated representations as separate schemas 
and combine them with `oneOf`?
   
   The same issue applies to `UnaryPredicate` and `SetPredicate`.
   



-- 
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]

Reply via email to