-
Notifications
You must be signed in to change notification settings - Fork 0
feat(tables): add partition_by and sorted_by configuration #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # TablePartitionKey | ||
|
|
||
| ## Properties | ||
|
|
||
| Name | Type | Description | Notes | ||
| ------------ | ------------- | ------------- | ------------- | ||
| **column** | **String** | Column the key reads. | | ||
| **transform** | **String** | How the value is derived from the column. One of `identity` (the column value itself), `year`, `month`, `day`, or `hour`. | | ||
|
|
||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # TableSortKey | ||
|
|
||
| ## Properties | ||
|
|
||
| Name | Type | Description | Notes | ||
| ------------ | ------------- | ------------- | ------------- | ||
| **column** | **String** | | | ||
| **direction** | Option<**String**> | `asc` (the default) or `desc`. | [optional] | ||
| **nulls** | Option<**String**> | Where nulls are placed: `first` or `last`. Defaults to the SQL default for the chosen direction. | [optional] | ||
|
|
||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * Hotdata API | ||
| * | ||
| * Powerful data platform API for managed databases, queries, and analytics. | ||
| * | ||
| * The version of the OpenAPI document: 1.0.0 | ||
| * Contact: [email protected] | ||
| * Generated by: https://openapi-generator.tech | ||
| */ | ||
|
|
||
| use crate::models; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| /// TablePartitionKey : One partition key of a table's storage layout. Partitioning groups rows that share a key value into their own files, so a query filtering on that key reads only the matching files. Keys are applied in the order given, and several keys may read the same column: to get one partition per calendar month, declare `year` and `month` on the timestamp column. A single calendar transform on its own is rarely what you want — `month` alone puts every March of every year in one partition. | ||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||
| pub struct TablePartitionKey { | ||
| /// Column the key reads. | ||
| #[serde(rename = "column")] | ||
| pub column: String, | ||
| /// How the value is derived from the column. One of `identity` (the column value itself), `year`, `month`, `day`, or `hour`. | ||
| #[serde(rename = "transform")] | ||
| pub transform: String, | ||
| } | ||
|
|
||
| impl TablePartitionKey { | ||
| /// One partition key of a table's storage layout. Partitioning groups rows that share a key value into their own files, so a query filtering on that key reads only the matching files. Keys are applied in the order given, and several keys may read the same column: to get one partition per calendar month, declare `year` and `month` on the timestamp column. A single calendar transform on its own is rarely what you want — `month` alone puts every March of every year in one partition. | ||
| pub fn new(column: String, transform: String) -> TablePartitionKey { | ||
| TablePartitionKey { column, transform } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Hotdata API | ||
| * | ||
| * Powerful data platform API for managed databases, queries, and analytics. | ||
| * | ||
| * The version of the OpenAPI document: 1.0.0 | ||
| * Contact: [email protected] | ||
| * Generated by: https://openapi-generator.tech | ||
| */ | ||
|
|
||
| use crate::models; | ||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| /// TableSortKey : One key of a table's sort order. Rows are written in this order, which keeps the values in each file within a narrow range and lets queries filtering on those columns skip files entirely. Most useful on columns you filter by ranges, such as a timestamp. | ||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||
| pub struct TableSortKey { | ||
| #[serde(rename = "column")] | ||
| pub column: String, | ||
| /// `asc` (the default) or `desc`. | ||
| #[serde( | ||
| rename = "direction", | ||
| default, | ||
| with = "::serde_with::rust::double_option", | ||
| skip_serializing_if = "Option::is_none" | ||
| )] | ||
| pub direction: Option<Option<String>>, | ||
| /// Where nulls are placed: `first` or `last`. Defaults to the SQL default for the chosen direction. | ||
| #[serde( | ||
| rename = "nulls", | ||
| default, | ||
| with = "::serde_with::rust::double_option", | ||
| skip_serializing_if = "Option::is_none" | ||
| )] | ||
| pub nulls: Option<Option<String>>, | ||
| } | ||
|
|
||
| impl TableSortKey { | ||
| /// One key of a table's sort order. Rows are written in this order, which keeps the values in each file within a narrow range and lets queries filtering on those columns skip files entirely. Most useful on columns you filter by ranges, such as a timestamp. | ||
| pub fn new(column: String) -> TableSortKey { | ||
| TableSortKey { | ||
| column, | ||
| direction: None, | ||
| nulls: None, | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nit: this bullet is the raw commit subject, not the SDK-facing description the rest of the file uses (not blocking). Compare the precedent for the very similar
keyaddition (CHANGELOG.md:82): "AddManagedTableDecl,AddManagedTableRequest, andDatabaseDefaultTableDeclgain an optionalkeyfield…". Consumers reading the release notes here don't learn that two new public types (TablePartitionKey,TableSortKey) were added or which models gained fields. Suggest rewording before release, e.g.: