diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 843254f..525c6c1 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -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 @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index d5900cd..78f25be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/AddManagedTableDecl.md b/docs/AddManagedTableDecl.md index 47de5dd..2e8c509 100644 --- a/docs/AddManagedTableDecl.md +++ b/docs/AddManagedTableDecl.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **constant_per_key** | Option<**Vec**> | 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**> | 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**](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**](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] diff --git a/docs/AddManagedTableRequest.md b/docs/AddManagedTableRequest.md index 79c3486..17a702d 100644 --- a/docs/AddManagedTableRequest.md +++ b/docs/AddManagedTableRequest.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **constant_per_key** | Option<**Vec**> | 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**> | 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**](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**](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] diff --git a/docs/DatabaseDefaultTableDecl.md b/docs/DatabaseDefaultTableDecl.md index ac4de2b..ad6dde8 100644 --- a/docs/DatabaseDefaultTableDecl.md +++ b/docs/DatabaseDefaultTableDecl.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **constant_per_key** | Option<**Vec**> | 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**> | 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**](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**](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] diff --git a/docs/TableInfo.md b/docs/TableInfo.md index 5f80878..2af9c05 100644 --- a/docs/TableInfo.md +++ b/docs/TableInfo.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **connection** | **String** | | **constant_per_key** | **Vec** | 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**](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**](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`. | diff --git a/docs/TableLayout.md b/docs/TableLayout.md new file mode 100644 index 0000000..d7cda81 --- /dev/null +++ b/docs/TableLayout.md @@ -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) + + diff --git a/src/models/add_managed_table_decl.rs b/src/models/add_managed_table_decl.rs index 35c35ec..67acf5a 100644 --- a/src/models/add_managed_table_decl.rs +++ b/src/models/add_managed_table_decl.rs @@ -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>, + #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] + pub layout: Option, #[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. @@ -36,6 +38,7 @@ impl AddManagedTableDecl { AddManagedTableDecl { constant_per_key: None, key: None, + layout: None, name, partition_by: None, sorted_by: None, diff --git a/src/models/add_managed_table_request.rs b/src/models/add_managed_table_request.rs index e9df50e..0fe16a2 100644 --- a/src/models/add_managed_table_request.rs +++ b/src/models/add_managed_table_request.rs @@ -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>, + #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] + pub layout: Option, #[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. @@ -36,6 +38,7 @@ impl AddManagedTableRequest { AddManagedTableRequest { constant_per_key: None, key: None, + layout: None, name, partition_by: None, sorted_by: None, diff --git a/src/models/database_default_table_decl.rs b/src/models/database_default_table_decl.rs index 136f536..e85ba7c 100644 --- a/src/models/database_default_table_decl.rs +++ b/src/models/database_default_table_decl.rs @@ -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>, + #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] + pub layout: Option, #[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. @@ -36,6 +38,7 @@ impl DatabaseDefaultTableDecl { DatabaseDefaultTableDecl { constant_per_key: None, key: None, + layout: None, name, partition_by: None, sorted_by: None, diff --git a/src/models/mod.rs b/src/models/mod.rs index 471f416..d15e81a 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -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; diff --git a/src/models/table_info.rs b/src/models/table_info.rs index ae8c07e..4be93fd 100644 --- a/src/models/table_info.rs +++ b/src/models/table_info.rs @@ -33,6 +33,8 @@ pub struct TableInfo { skip_serializing_if = "Option::is_none" )] pub last_sync: Option>, + #[serde(rename = "layout")] + pub layout: models::TableLayout, /// 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, @@ -52,6 +54,7 @@ impl TableInfo { pub fn new( connection: String, constant_per_key: Vec, + layout: models::TableLayout, partition_by: Vec, schema: String, sorted_by: Vec, @@ -63,6 +66,7 @@ impl TableInfo { connection, constant_per_key, last_sync: None, + layout, partition_by, schema, sorted_by, diff --git a/src/models/table_layout.rs b/src/models/table_layout.rs new file mode 100644 index 0000000..20bc216 --- /dev/null +++ b/src/models/table_layout.rs @@ -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 + } +}