-
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
explain: support EXPLAIN CREATE INDEX
#22021
Conversation
1219030
to
4a1a4da
Compare
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.
Coverage mostly looks good: https://buildkite.com/materialize/coverage/builds/236#018ad8d2-4da7-4f15-b52a-66c29d6d8299
I'll add one datadriven test for the BROKEN syntax.
E: Into<AdapterError>, | ||
{ | ||
if guard { | ||
let r: Result<Result<R, E>, _> = mz_ore::panic::catch_unwind(AssertUnwindSafe(f)); |
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.
Could we have a test case that exercises this? Or does mz_panic not cause the panic in the right stage?
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 can only test catch_unwind(broken, "global", f)
and catch_unwind(broken, "local", f)
calls with mz_panic()
. I'm not aware of a good way to test hir_to_mir
and finalize_dataflow
stages.
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 added some EXPLAIN BROKEN <statement>
SLT tests in a new commit.
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.
Removed the EXPLAIN BROKEN <statement>
SLT tests because they are breaking the CI analysis step (the panic
and ERROR
messages are flagged). If we have a fix for that and I'll add it back.
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 added the EXPLAIN BROKEN back with the CI analysis fix.
5c0bbdd
to
f479bf6
Compare
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.
LGTM, just minor comments
note that the "index export" dataflows use ReadStorage, e.g.
...
This is surprising to me because it somehow alludes that the materialize.public.q07 source is written to S3 with a perist sink. Maybe this is an error in the usage type inference code?
Oh, good catch! This should be a different category from all the existing Get printings (AccessStrategy
): not a local Get, not a Persist read, not an existing index read. It's a read of a GlobalId, but it's still a read of something from the same dataflow, just from a different item in objects_to_build
. I've created an issue: https://github.com/MaterializeInc/materialize/issues/22064
} | ||
} | ||
|
||
// Execute the `optimize/finalize_dataflow` stage. |
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.
optimize/finalize_dataflow
is the Plan::finalize_dataflow
fn, but this call is to the Coordinator::finalize_dataflow
fn, which does a few more things before calling the other one.
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.
Yes, it preps up the dataflow as_of
before calling Plan::finalize_dataflow
(which is the method that produces the span
. Conceptually the comment makes sense though (the stage is executed by the commented code snippet), and I would rather keep this consistent across all Coordinator::explain_
methods, as this code will hopefully be removed in the next weeks.
}); | ||
|
||
// Global optimziation | ||
// ------------------- |
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.
sequence_create_index
has a ensure_cluster_can_host_compute_item
call. Is it ok that we are not calling this here?
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.
We are also not calling this in explain_materialized_view
, and there are other validation steps that we are not doing (like validate_timeline_context
and validate_system_column_references
).
Overall I would prefer to tackle this problem after we unify the optimizer interface between the two methods because then all other differences will become easier to track down.
- Pull out repeated `catch_unwind` definitions at the module level. - Simplify `optimize/local` execution blocks.
76274d5
to
58f6283
Compare
Update the docs to add the newly supported syntax introduced in some recently merged PRs (MaterializeInc#21708, MaterializeInc#21973, and MaterializeInc#22021).
Update the docs to add the newly supported syntax introduced in some recently merged PRs (MaterializeInc#21708, MaterializeInc#21973, and MaterializeInc#22021).
Update the docs to add the newly supported syntax introduced in some recently merged PRs (MaterializeInc#21708, MaterializeInc#21973, and MaterializeInc#22021).
Update the docs to add the newly supported syntax introduced in some recently merged PRs (MaterializeInc#21708, MaterializeInc#21973, and MaterializeInc#22021).
Update the docs to add the newly supported syntax introduced in some recently merged PRs (MaterializeInc#21708, MaterializeInc#21973, and MaterializeInc#22021).
Update the docs to add the newly supported syntax introduced in some recently merged PRs (MaterializeInc#21708, MaterializeInc#21973, and MaterializeInc#22021).
Update the docs to add the newly supported syntax introduced in some recently merged PRs (MaterializeInc#21708, MaterializeInc#21973, and MaterializeInc#22021).
Add support for
syntax.
Motivation
Closes MaterializeInc/database-issues#5301.
Tips for reviewer
EXPLAIN CREATE MATERIALIZED VIEW
#21973.tpch_select.slt
and changed the workload to useCREATE DEFAULT INDEX ON $qXX
where$qXX
is a view for query XX (you can twotpch_*.slt
files to see what changed).@ggevay note that the "index export" dataflows use
ReadStorage
, e.g.This is surprising to me because it somehow alludes that the
materialize.public.q07
source is written to S3 with aperist
sink. Maybe this is an error in the usage type inference code?Checklist
$T ⇔ Proto$T
mapping (possibly in a backwards-incompatible way), then it is tagged with aT-proto
label.