Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ docs/SavedQuerySummary.md
docs/SavedQueryVersionInfo.md
docs/SubmitJobResponse.md
docs/TableInfo.md
docs/TableLayout.md
docs/TablePartitionKey.md
docs/TableProfileResponse.md
docs/TableSortKey.md
Expand Down Expand Up @@ -243,6 +244,7 @@ src/models/saved_query_summary.rs
src/models/saved_query_version_info.rs
src/models/submit_job_response.rs
src/models/table_info.rs
src/models/table_layout.rs
src/models/table_partition_key.rs
src/models/table_profile_response.rs
src/models/table_sort_key.rs
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- feat(tables): add layout property to table schemas
- Regenerate the client from the updated Hotdata OpenAPI spec
- feat(jobs): add ivf_rebalance_sweep job type
- chore(query): clarify write statement and dialect documentation
Expand Down
1 change: 1 addition & 0 deletions docs/AddManagedTableDecl.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**constant_per_key** | Option<**Vec<String>**> | Columns whose value is determined by this table's `key`: for every uploaded row, every stored row sharing its key holds the same value of these columns. Declaring this lets a keyed mutation (`delete`, `update`, `upsert`) restrict its search for prior versions to the values the upload carries, which prunes far harder than the key alone when the key's own file statistics are weak. Omit (the default) for the unrestricted search. **Correctness-affecting, not a hint.** If the assertion is false, a mutation supersedes one version of a key and appends beside another, silently duplicating it. Declare it only where the invariant is established. | [optional]
**key** | Option<**Vec<String>**> | Columns that uniquely identify a row, enabling the key-based load modes (`delete`, `update`, `upsert`) on this table: those loads match rows by these columns' values. Omit (the default) to declare no key; the table can still be loaded with `replace` and `append`, but key-based modes are then rejected. | [optional]
**layout** | Option<[**models::TableLayout**](TableLayout.md)> | | [optional]
**name** | **String** | |
**partition_by** | Option<[**Vec<models::TablePartitionKey>**](TablePartitionKey.md)> | Partition keys for this table, applied in order. Omit for no partitioning. Declared when the table is created and fixed thereafter. | [optional]
**sorted_by** | Option<[**Vec<models::TableSortKey>**](TableSortKey.md)> | Sort keys for this table, applied in order. Omit for no sort order. Declared when the table is created and fixed thereafter. A table with a sort order cannot be indexed: creating any index on it is refused, so leave this empty on a table you plan to search. | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/AddManagedTableRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**constant_per_key** | Option<**Vec<String>**> | Columns whose value is determined by this table's `key`: for every uploaded row, every stored row sharing its key holds the same value of these columns. Declaring this lets a keyed mutation (`delete`, `update`, `upsert`) restrict its search for prior versions to the values the upload carries, which prunes far harder than the key alone when the key's own file statistics are weak. Omit (the default) for the unrestricted search. **Correctness-affecting, not a hint.** If the assertion is false, a mutation supersedes one version of a key and appends beside another, silently duplicating it. Declare it only where the invariant is established. | [optional]
**key** | Option<**Vec<String>**> | Columns that uniquely identify a row, enabling the key-based load modes (`delete`, `update`, `upsert`) on this table: those loads match rows by these columns' values. Omit (the default) to declare no key; the table can still be loaded with `replace` and `append`, but key-based modes are then rejected. | [optional]
**layout** | Option<[**models::TableLayout**](TableLayout.md)> | | [optional]
**name** | **String** | |
**partition_by** | Option<[**Vec<models::TablePartitionKey>**](TablePartitionKey.md)> | Partition keys for this table, applied in order. Omit for no partitioning. Declared when the table is created and fixed thereafter. | [optional]
**sorted_by** | Option<[**Vec<models::TableSortKey>**](TableSortKey.md)> | Sort keys for this table, applied in order. Omit for no sort order. Declared when the table is created and fixed thereafter. A table with a sort order cannot be indexed: creating any index on it is refused, so leave this empty on a table you plan to search. | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/DatabaseDefaultTableDecl.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**constant_per_key** | Option<**Vec<String>**> | Columns whose value is determined by this table's `key`: for every uploaded row, every stored row sharing its key holds the same value of these columns. Declaring this lets a keyed mutation (`delete`, `update`, `upsert`) restrict its search for prior versions to the values the upload carries, which prunes far harder than the key alone when the key's own file statistics are weak. Omit (the default) for the unrestricted search. **Correctness-affecting, not a hint.** If the assertion is false, a mutation supersedes one version of a key and appends beside another, silently duplicating it. Declare it only where the invariant is established. | [optional]
**key** | Option<**Vec<String>**> | Columns that uniquely identify a row, enabling the key-based load modes (`delete`, `update`, `upsert`) on this table: those loads match rows by these columns' values. Omit (the default) to declare no key; the table can still be loaded with `replace` and `append`, but key-based modes are then rejected. | [optional]
**layout** | Option<[**models::TableLayout**](TableLayout.md)> | | [optional]
**name** | **String** | |
**partition_by** | Option<[**Vec<models::TablePartitionKey>**](TablePartitionKey.md)> | Partition keys for this table, applied in order. Omit for no partitioning. Declared when the table is created and fixed thereafter. | [optional]
**sorted_by** | Option<[**Vec<models::TableSortKey>**](TableSortKey.md)> | Sort keys for this table, applied in order. Omit for no sort order. Declared when the table is created and fixed thereafter. A table with a sort order cannot be indexed: creating any index on it is refused, so leave this empty on a table you plan to search. | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/TableInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**connection** | **String** | |
**constant_per_key** | **Vec<String>** | Columns the table declares constant for a given key: for every row, any other row sharing its key holds the same value of these columns. Declaring this lets a keyed mutation narrow its search for prior versions to the values the upload carries. Empty when none is declared, which is the unrestricted search. Unlike `partition_by` and `sorted_by` this is NOT fixed at creation — it changes only which files a mutation opens, never how rows are written — so read it here rather than assuming a declaration took effect. |
**last_sync** | Option<**String**> | | [optional]
**layout** | [**models::TableLayout**](TableLayout.md) | |
**partition_by** | [**Vec<models::TablePartitionKey>**](TablePartitionKey.md) | The table's partition keys, in the order they were declared when the table was created. Empty when the table is not partitioned. A table's storage layout is fixed when the table is created and cannot be changed afterwards, so this is how to confirm a table really was created with the layout that was asked for. The field is always present: an empty array means \"no partitioning declared\", which is not the same as a response that omits the field entirely. Reported for tables in a Hotdata instant database, which are the only ones whose layout is declared here. A table discovered from an external connection always reports an empty array — its layout belongs to the upstream system, so an empty array there means \"not known from here\", not \"confirmed unpartitioned\". |
**schema** | **String** | |
**sorted_by** | [**Vec<models::TableSortKey>**](TableSortKey.md) | The table's sort keys, in the order they were declared when the table was created. Empty when no sort order was declared. Always present, and limited to tables in a Hotdata instant database, for the same reasons as `partition_by`. |
Expand Down
13 changes: 13 additions & 0 deletions docs/TableLayout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TableLayout

## Enum Variants

| Name | Value |
|---- | -----|
| Analytical | analytical |
| PointLookup | point_lookup |


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


3 changes: 3 additions & 0 deletions src/models/add_managed_table_decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub struct AddManagedTableDecl {
/// Columns that uniquely identify a row, enabling the key-based load modes (`delete`, `update`, `upsert`) on this table: those loads match rows by these columns' values. Omit (the default) to declare no key; the table can still be loaded with `replace` and `append`, but key-based modes are then rejected.
#[serde(rename = "key", skip_serializing_if = "Option::is_none")]
pub key: Option<Vec<String>>,
#[serde(rename = "layout", skip_serializing_if = "Option::is_none")]
pub layout: Option<models::TableLayout>,
#[serde(rename = "name")]
pub name: String,
/// Partition keys for this table, applied in order. Omit for no partitioning. Declared when the table is created and fixed thereafter.
Expand All @@ -36,6 +38,7 @@ impl AddManagedTableDecl {
AddManagedTableDecl {
constant_per_key: None,
key: None,
layout: None,
name,
partition_by: None,
sorted_by: None,
Expand Down
3 changes: 3 additions & 0 deletions src/models/add_managed_table_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub struct AddManagedTableRequest {
/// Columns that uniquely identify a row, enabling the key-based load modes (`delete`, `update`, `upsert`) on this table: those loads match rows by these columns' values. Omit (the default) to declare no key; the table can still be loaded with `replace` and `append`, but key-based modes are then rejected.
#[serde(rename = "key", skip_serializing_if = "Option::is_none")]
pub key: Option<Vec<String>>,
#[serde(rename = "layout", skip_serializing_if = "Option::is_none")]
pub layout: Option<models::TableLayout>,
#[serde(rename = "name")]
pub name: String,
/// Partition keys for this table, applied in order. Omit for no partitioning. Declared when the table is created and fixed thereafter.
Expand All @@ -36,6 +38,7 @@ impl AddManagedTableRequest {
AddManagedTableRequest {
constant_per_key: None,
key: None,
layout: None,
name,
partition_by: None,
sorted_by: None,
Expand Down
3 changes: 3 additions & 0 deletions src/models/database_default_table_decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub struct DatabaseDefaultTableDecl {
/// Columns that uniquely identify a row, enabling the key-based load modes (`delete`, `update`, `upsert`) on this table: those loads match rows by these columns' values. Omit (the default) to declare no key; the table can still be loaded with `replace` and `append`, but key-based modes are then rejected.
#[serde(rename = "key", skip_serializing_if = "Option::is_none")]
pub key: Option<Vec<String>>,
#[serde(rename = "layout", skip_serializing_if = "Option::is_none")]
pub layout: Option<models::TableLayout>,
#[serde(rename = "name")]
pub name: String,
/// Partition keys for this table, applied in order. Omit for no partitioning. Declared when the table is created and fixed thereafter.
Expand All @@ -36,6 +38,7 @@ impl DatabaseDefaultTableDecl {
DatabaseDefaultTableDecl {
constant_per_key: None,
key: None,
layout: None,
name,
partition_by: None,
sorted_by: None,
Expand Down
2 changes: 2 additions & 0 deletions src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ pub mod submit_job_response;
pub use self::submit_job_response::SubmitJobResponse;
pub mod table_info;
pub use self::table_info::TableInfo;
pub mod table_layout;
pub use self::table_layout::TableLayout;
pub mod table_partition_key;
pub use self::table_partition_key::TablePartitionKey;
pub mod table_profile_response;
Expand Down
4 changes: 4 additions & 0 deletions src/models/table_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub struct TableInfo {
skip_serializing_if = "Option::is_none"
)]
pub last_sync: Option<Option<String>>,
#[serde(rename = "layout")]
pub layout: models::TableLayout,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: (not blocking) Add #[serde(default)] to layout, or mark layout optional in the OpenAPI spec. A required layout makes TableInfo deserialization fail when a server response omits the field. Servers deployed before hotdata-dev/www#494 omit layout, so list-tables calls from this SDK version fail against those servers. TableLayout already implements Default (Analytical), so the fallback is safe. The TableInfo::new signature also changes. Mark that change as breaking in CHANGELOG.md for the next version bump.

/// The table's partition keys, in the order they were declared when the table was created. Empty when the table is not partitioned. A table's storage layout is fixed when the table is created and cannot be changed afterwards, so this is how to confirm a table really was created with the layout that was asked for. The field is always present: an empty array means \"no partitioning declared\", which is not the same as a response that omits the field entirely. Reported for tables in a Hotdata instant database, which are the only ones whose layout is declared here. A table discovered from an external connection always reports an empty array — its layout belongs to the upstream system, so an empty array there means \"not known from here\", not \"confirmed unpartitioned\".
#[serde(rename = "partition_by")]
pub partition_by: Vec<models::TablePartitionKey>,
Expand All @@ -52,6 +54,7 @@ impl TableInfo {
pub fn new(
connection: String,
constant_per_key: Vec<String>,
layout: models::TableLayout,
partition_by: Vec<models::TablePartitionKey>,
schema: String,
sorted_by: Vec<models::TableSortKey>,
Expand All @@ -63,6 +66,7 @@ impl TableInfo {
connection,
constant_per_key,
last_sync: None,
layout,
partition_by,
schema,
sorted_by,
Expand Down
37 changes: 37 additions & 0 deletions src/models/table_layout.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Hotdata API
*
* Powerful data platform API for instant databases, queries, and analytics.
*
* The version of the OpenAPI document: 1.0.0
* Contact: developers@hotdata.dev
* Generated by: https://openapi-generator.tech
*/

use crate::models;
use serde::{Deserialize, Serialize};

/// TableLayout : Storage layout of a table.
/// Storage layout of a table.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TableLayout {
#[serde(rename = "analytical")]
Analytical,
#[serde(rename = "point_lookup")]
PointLookup,
}

impl std::fmt::Display for TableLayout {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Self::Analytical => write!(f, "analytical"),
Self::PointLookup => write!(f, "point_lookup"),
}
}
}

impl Default for TableLayout {
fn default() -> TableLayout {
Self::Analytical
}
}
Loading