-
Notifications
You must be signed in to change notification settings - Fork 465
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
coord,sql: fix some table buglets #3992
Conversation
/// | ||
/// Panics if `id` does not exist, or if `id` is not an object on which | ||
/// indexes can be built. | ||
pub fn default_index_for(&self, id: GlobalId) -> Option<GlobalId> { |
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.
This function is much clearer, thanks!
Is the selection of the default index something we plan on improving later on?
src/coord/src/coord.rs
Outdated
@@ -2026,7 +2026,7 @@ where | |||
return; | |||
} | |||
// A valid index is any index on `id` that is known to the dataflow | |||
// layer, as indicated by its presence in `self.indexes`. | |||
// layer, as indicated by its presence in `self.indexes`.s |
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.
The s
snuck back in!
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.
Ugh! Thanks!
@@ -976,7 +988,20 @@ impl Catalog { | |||
}] | |||
} | |||
Op::DropItem(id) => { | |||
if !self.get_by_id(&id).item().is_temporary() { | |||
let entry = self.get_by_id(&id); |
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.
🎉
@@ -1806,6 +1806,16 @@ fn handle_insert( | |||
match source { | |||
InsertSource::Query(query) => { | |||
let table = scx.catalog.get_item(&scx.resolve_item(table_name)?); | |||
if table.id().is_system() { |
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.
Ah - nice catch!
...without dropping the table too, at least. Unlike sources, where an unmaterialized source is reasonable, tables are implicitly always materialized, since Materialize is the source of truth. Fix #3905.
The first commit is a follow-up from #3982 which I forgot to push before merging. The second commit ensures that a table's default index is not dropped, which came up in #3982 and is tracked in MaterializeInc/database-issues#1213. The third commit is another table bug I discovered that I didn't bother filing an issue for.
I believe the only remaining issue before marking tables non-experimental is MaterializeInc/database-issues#1226.We're good to go after this, I believe!This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)