Skip to content

Conversation

@gruuya
Copy link
Contributor

@gruuya gruuya commented Feb 28, 2024

This enables metastore to setup delta tables with a different object store than the one configured in the toml file.

Currently does not support writes, due to metastore limitations.

@gruuya gruuya requested a review from mildbyte February 28, 2024 06:05
src/provider.rs Outdated

if let Err(err) = delta_table.load().await {
warn!("Failed to load table {name}: {err}");
println!("{err}");
Copy link
Contributor

Choose a reason for hiding this comment

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

leftover debug code?

Suggested change
println!("{err}");

let table_log_store = match table.location {
// Use the provided customized location
Some(location) => {
let store = stores.get(&location).expect("store for location exists");
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this an Err()? We don't want to panic and crash if the upstream API doesn't give us a store for the right prefix and this returns a CatalogResult anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup planned to do it and forgot, thanks.

Path::from("/"),
))
} else {
// TODO: this won't work if the default store has the same scheme as the queried one
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean we can't support multiple stores that use the same scheme (s3) but have different buckets / prefixes or is this benign?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is benign, this pathway doesn't even take place, since we instantiate all the tables with object stores (and not url + object store options).

The only reason we need to register these in the first place is so that delta-rs knows all allowed schemes. Will return an Err here explicitly to clarify that.

Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@gruuya gruuya merged commit 39f18f8 into main Feb 28, 2024
@gruuya gruuya deleted the dyn-store branch February 28, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants