Skip to content

Commit 439938c

Browse files
authored
feat: add partition spec to rest.yaml (#297)
1 parent e808926 commit 439938c

32 files changed

Lines changed: 2223 additions & 0 deletions

File tree

docs/src/rest.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4152,6 +4152,69 @@ components:
41524152
type: string
41534153
description: Optional transaction identifier
41544154

4155+
PartitionTransform:
4156+
type: object
4157+
description: Well-known partition transform
4158+
required:
4159+
- type
4160+
properties:
4161+
type:
4162+
type: string
4163+
description: Transform type (identity, year, month, day, hour, bucket, multi_bucket, truncate)
4164+
num_buckets:
4165+
type: integer
4166+
description: Number of buckets for bucket transforms
4167+
width:
4168+
type: integer
4169+
description: Truncation width for truncate transforms
4170+
4171+
PartitionField:
4172+
type: object
4173+
description: Partition field definition
4174+
required:
4175+
- field_id
4176+
- source_ids
4177+
- result_type
4178+
properties:
4179+
field_id:
4180+
type: string
4181+
description: Unique identifier for this partition field (must not be renamed)
4182+
example: "event_year"
4183+
source_ids:
4184+
type: array
4185+
items:
4186+
type: integer
4187+
description: Field IDs of the source columns in the schema
4188+
example: [1]
4189+
transform:
4190+
$ref: '#/components/schemas/PartitionTransform'
4191+
description: Well-known partition transform. Exactly one of transform or expression must be specified.
4192+
expression:
4193+
type: string
4194+
description: DataFusion SQL expression using col0, col1, ... as column references. Exactly one of transform or expression must be specified.
4195+
example: "date_part('year', col0)"
4196+
result_type:
4197+
$ref: '#/components/schemas/JsonArrowDataType'
4198+
description: The output type of the partition value (JsonArrowDataType format)
4199+
example: {"type": "int32"}
4200+
4201+
PartitionSpec:
4202+
type: object
4203+
description: Partition spec definition
4204+
required:
4205+
- id
4206+
- fields
4207+
properties:
4208+
id:
4209+
type: integer
4210+
description: The spec version ID
4211+
example: 1
4212+
fields:
4213+
type: array
4214+
items:
4215+
$ref: '#/components/schemas/PartitionField'
4216+
description: Array of partition field definitions
4217+
41554218
responses:
41564219
ListNamespacesResponse:
41574220
description: A list of namespaces

java/lance-namespace-apache-client/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ Class | Method | HTTP request | Description
319319
- [MultiMatchQuery](docs/MultiMatchQuery.md)
320320
- [NamespaceExistsRequest](docs/NamespaceExistsRequest.md)
321321
- [NewColumnTransform](docs/NewColumnTransform.md)
322+
- [PartitionField](docs/PartitionField.md)
323+
- [PartitionSpec](docs/PartitionSpec.md)
324+
- [PartitionTransform](docs/PartitionTransform.md)
322325
- [PhraseQuery](docs/PhraseQuery.md)
323326
- [QueryTableRequest](docs/QueryTableRequest.md)
324327
- [QueryTableRequestColumns](docs/QueryTableRequestColumns.md)

java/lance-namespace-apache-client/api/openapi.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6169,6 +6169,63 @@ components:
61696169
transaction_id:
61706170
description: Optional transaction identifier
61716171
type: string
6172+
PartitionTransform:
6173+
description: Well-known partition transform
6174+
properties:
6175+
type:
6176+
description: "Transform type (identity, year, month, day, hour, bucket,\
6177+
\ multi_bucket, truncate)"
6178+
type: string
6179+
num_buckets:
6180+
description: Number of buckets for bucket transforms
6181+
type: integer
6182+
width:
6183+
description: Truncation width for truncate transforms
6184+
type: integer
6185+
required:
6186+
- type
6187+
PartitionField:
6188+
description: Partition field definition
6189+
properties:
6190+
field_id:
6191+
description: Unique identifier for this partition field (must not be renamed)
6192+
example: event_year
6193+
type: string
6194+
source_ids:
6195+
description: Field IDs of the source columns in the schema
6196+
example:
6197+
- 1
6198+
items:
6199+
type: integer
6200+
type: array
6201+
transform:
6202+
$ref: '#/components/schemas/PartitionTransform'
6203+
expression:
6204+
description: "DataFusion SQL expression using col0, col1, ... as column\
6205+
\ references. Exactly one of transform or expression must be specified."
6206+
example: "date_part('year', col0)"
6207+
type: string
6208+
result_type:
6209+
$ref: '#/components/schemas/JsonArrowDataType'
6210+
required:
6211+
- field_id
6212+
- result_type
6213+
- source_ids
6214+
PartitionSpec:
6215+
description: Partition spec definition
6216+
properties:
6217+
id:
6218+
description: The spec version ID
6219+
example: 1
6220+
type: integer
6221+
fields:
6222+
description: Array of partition field definitions
6223+
items:
6224+
$ref: '#/components/schemas/PartitionField'
6225+
type: array
6226+
required:
6227+
- fields
6228+
- id
61726229
QueryTableRequest_columns:
61736230
description: |
61746231
Optional columns to return. Provide either column_names or column_aliases, not both.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
3+
# PartitionField
4+
5+
Partition field definition
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**fieldId** | **String** | Unique identifier for this partition field (must not be renamed) | |
12+
|**sourceIds** | **List<Integer>** | Field IDs of the source columns in the schema | |
13+
|**transform** | [**PartitionTransform**](PartitionTransform.md) | Well-known partition transform. Exactly one of transform or expression must be specified. | [optional] |
14+
|**expression** | **String** | DataFusion SQL expression using col0, col1, ... as column references. Exactly one of transform or expression must be specified. | [optional] |
15+
|**resultType** | [**JsonArrowDataType**](JsonArrowDataType.md) | The output type of the partition value (JsonArrowDataType format) | |
16+
17+
18+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
# PartitionSpec
4+
5+
Partition spec definition
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**id** | **Integer** | The spec version ID | |
12+
|**fields** | [**List<PartitionField>**](PartitionField.md) | Array of partition field definitions | |
13+
14+
15+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
# PartitionTransform
4+
5+
Well-known partition transform
6+
7+
## Properties
8+
9+
| Name | Type | Description | Notes |
10+
|------------ | ------------- | ------------- | -------------|
11+
|**type** | **String** | Transform type (identity, year, month, day, hour, bucket, multi_bucket, truncate) | |
12+
|**numBuckets** | **Integer** | Number of buckets for bucket transforms | [optional] |
13+
|**width** | **Integer** | Truncation width for truncate transforms | [optional] |
14+
15+
16+

0 commit comments

Comments
 (0)