nevzheng commented on code in PR #17138:
URL: https://github.com/apache/iceberg/pull/17138#discussion_r3555555393
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -2606,7 +2630,194 @@ components:
child:
$ref: '#/components/schemas/Expression'
+ UnaryPredicate:
+ description: >
+ A predicate that tests a single value expression. Replaces the
deprecated
+ UnaryExpression that used 'term'.
+ 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. Replaces the
deprecated
+ LiteralExpression that used 'term' and 'value'.
+ 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 tests whether a value expression is in a set of
literals.
+ Replaces the deprecated SetExpression that used 'term'.
+ 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 per Iceberg Expressions spec, Appendix B.
+ 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: integer
+ - type: boolean
+ - type: 'null'
+ - type: object
+ required:
+ - type
+ - value
+ properties:
+ type:
+ type: string
+ const: "literal"
+ value:
+ $ref: '#/components/schemas/PrimitiveTypeValue'
+ data-type:
+ $ref: '#/components/schemas/PrimitiveType'
+
+ Literals:
+ description: >
+ A set of literal values per Iceberg Expressions spec, Appendix B.
+ Two JSON forms: a bare array of literals, or a typed object with an
+ explicit data-type applied to all values.
+ oneOf:
+ - type: array
+ items:
+ $ref: '#/components/schemas/Literal'
+ - type: object
+ required:
+ - type
+ - values
+ properties:
+ type:
+ type: string
+ const: "literals"
+ values:
+ type: array
+ items:
+ $ref: '#/components/schemas/PrimitiveTypeValue'
+ data-type:
+ $ref: '#/components/schemas/PrimitiveType'
+
+ FieldReference:
Review Comment:
Should we have two types? We're allowed to define our own.
`FieldReferenceByName`, `FieldReferenceById`, `FieldReference
(FieldReferenceByName| FieldReferenceById). This allows expressions to specify
which variant they accept.
```openapi
FieldReference:
description: >
A reference to a field, by field ID or by name.
oneOf:
- $ref: '#/components/schemas/FieldReferenceById'
- $ref: '#/components/schemas/FieldReferenceByName'
FieldReferenceById:
description: A reference to a field by field ID (bound).
type: object
required:
- type
- id
properties:
type:
type: string
const: "reference"
id:
type: integer
FieldReferenceByName:
description: A reference to a field by name (unbound).
type: object
required:
- type
- name
properties:
type:
type: string
const: "reference"
name:
type: string
```
--
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]