Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions open-api/rest-catalog-open-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class ExpressionType(BaseModel):
'not-null',
'is-nan',
'not-nan',
'st-intersects',
'st-disjoint',
],
)

Expand All @@ -145,6 +147,11 @@ class FalseExpression(BaseModel):
type: str = Field('false', const=True)


class CoordinateRange(BaseModel):
min: float
max: float


class Reference(BaseModel):
__root__: str = Field(..., example=['column-name'])

Expand Down Expand Up @@ -997,6 +1004,13 @@ class RenameTableRequest(BaseModel):
destination: TableIdentifier


class BoundingBox(BaseModel):
x: CoordinateRange
y: CoordinateRange
z: Optional[CoordinateRange] = None
m: Optional[CoordinateRange] = None


class TransformTerm(BaseModel):
type: str = Field('transform', const=True)
transform: Transform
Expand Down Expand Up @@ -1123,6 +1137,12 @@ class SetExpression(BaseModel):
values: List[PrimitiveTypeValue]


class SpatialExpression(BaseModel):
type: Literal['st-intersects', 'st-disjoint']
term: Term
value: BoundingBox


class ResidualFilter6(SetExpression, ResidualFilter1):
"""
An optional filter to be applied to rows in this file scan task.
Expand All @@ -1144,6 +1164,13 @@ class ResidualFilter8(UnaryExpression, ResidualFilter1):
"""


class ResidualFilter9(SpatialExpression, ResidualFilter1):
"""
An optional filter to be applied to rows in this file scan task.
If the residual is not present, the client must produce the residual or use the original filter.
"""


class StructField(BaseModel):
id: int
name: str
Expand Down Expand Up @@ -1188,6 +1215,7 @@ class Expression(BaseModel):
SetExpression,
LiteralExpression,
UnaryExpression,
SpatialExpression,
]


Expand Down Expand Up @@ -1544,6 +1572,7 @@ class ResidualFilter(BaseModel):
ResidualFilter6,
ResidualFilter7,
ResidualFilter8,
ResidualFilter9,
] = Field(
...,
description='An optional filter to be applied to rows in this file scan task.\nIf the residual is not present, the client must produce the residual or use the original filter.',
Expand Down
46 changes: 46 additions & 0 deletions open-api/rest-catalog-open-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,7 @@ components:
- $ref: '#/components/schemas/SetExpression'
- $ref: '#/components/schemas/LiteralExpression'
- $ref: '#/components/schemas/UnaryExpression'
- $ref: '#/components/schemas/SpatialExpression'

ExpressionType:
type: string
Expand All @@ -2275,6 +2276,8 @@ components:
- "not-null"
- "is-nan"
- "not-nan"
- "st-intersects"
- "st-disjoint"

TrueExpression:
type: object
Expand Down Expand Up @@ -2365,6 +2368,49 @@ components:
items:
$ref: '#/components/schemas/PrimitiveTypeValue'

SpatialExpression:
type: object
required:
- type
- term
- value
properties:
type:
$ref: '#/components/schemas/ExpressionType'
enum: ["st-intersects", "st-disjoint"]
term:
$ref: '#/components/schemas/Term'
value:
$ref: '#/components/schemas/BoundingBox'

BoundingBox:
type: object
required:
- x
- y
properties:
x:
$ref: '#/components/schemas/CoordinateRange'
y:
$ref: '#/components/schemas/CoordinateRange'
z:
$ref: '#/components/schemas/CoordinateRange'
m:
$ref: '#/components/schemas/CoordinateRange'

CoordinateRange:
type: object
required:
- min
- max
properties:
min:
type: number
format: double
max:
type: number
format: double

Term:
oneOf:
- $ref: '#/components/schemas/Reference'
Expand Down