-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use the storage location name as the key in the clade schema #556
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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 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 |
---|---|---|
|
@@ -97,7 +97,7 @@ impl Metastore { | |
let store_options = catalog_schemas | ||
.stores | ||
.into_iter() | ||
.map(|store| (store.location, store.options)) | ||
.map(|store| (store.name, (store.location, store.options))) | ||
.collect(); | ||
|
||
// Turn the list of all collections, tables and their columns into a nested map. | ||
|
@@ -119,7 +119,7 @@ impl Metastore { | |
async fn build_schema( | ||
&self, | ||
schema: SchemaObject, | ||
store_options: &HashMap<String, HashMap<String, String>>, | ||
store_options: &HashMap<String, (String, HashMap<String, String>)>, | ||
) -> CatalogResult<(Arc<str>, Arc<SeafowlSchema>)> { | ||
let schema_name = schema.name; | ||
|
||
|
@@ -140,21 +140,21 @@ impl Metastore { | |
async fn build_table( | ||
&self, | ||
table: TableObject, | ||
store_options: &HashMap<String, HashMap<String, String>>, | ||
store_options: &HashMap<String, (String, HashMap<String, String>)>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's 4 Strings in this type and it wasn't clear on first reading what each of them is. Maybe add a comment about this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, will do. |
||
) -> CatalogResult<(Arc<str>, Arc<dyn TableProvider>)> { | ||
// Build a delta table but don't load it yet; we'll do that only for tables that are | ||
// actually referenced in a statement, via the async `table` method of the schema provider. | ||
// TODO: this means that any `information_schema.columns` query will serially load all | ||
// delta tables present in the database. The real fix for this is to make DF use `TableSource` | ||
// for the information schema, and then implement `TableSource` for `DeltaTable` in delta-rs. | ||
|
||
let table_log_store = match table.location { | ||
let table_log_store = match table.store { | ||
// Use the provided customized location | ||
Some(location) => { | ||
let this_store_options = store_options | ||
.get(&location) | ||
Some(name) => { | ||
let (location, this_store_options) = store_options | ||
.get(&name) | ||
.ok_or(CatalogError::Generic { | ||
reason: format!("Object store for location {location} not found"), | ||
reason: format!("Object store with name {name} not found"), | ||
})? | ||
.clone(); | ||
|
||
|
This file contains 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 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
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.
I know we don't care about backwards compatibility here, but should we try to follow Protobuf guidelines on field number assignment?: https://protobuf.dev/programming-guides/proto3/#assigning . This could help make errors clearer in case of a server/client protocol mismatch.
Specifically: