Skip to content

Commit

Permalink
Support EXPLAIN CREATE MATERIALIZED VIEW
Browse files Browse the repository at this point in the history
See 21973
  • Loading branch information
def- committed Sep 26, 2023
1 parent cd411c5 commit 48ff8d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ grep -v "array_fill on " |
grep -v "mz_aclitem grantor cannot be PUBLIC role" |
grep -v "is out of range for type numeric: exceeds maximum precision" |
grep -v "requested length too large" |
grep -v "cannot materialize call to" | # CREATE MATERIALIZED VIEW

grep -v "operator is not unique" | # random nulls
grep -v "cannot be matched" | # random nulls
Expand All @@ -113,6 +114,7 @@ grep -v "CAST does not support casting from" | # random nulls
grep -v "number of columns must be a positive integer literal" |
grep -v "regex_extract requires a string literal as its first argument" |
grep -v -E "column \".*\" does not exist" | # https://github.com/MaterializeInc/materialize/issues/20533
grep -v -E "role \".*\" does not exist" |
grep -v "SET clause does not support casting from interval to integer" |

grep -v "Expected joined table, found" | # Should fix for multi table join
Expand Down
9 changes: 6 additions & 3 deletions grammar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -742,13 +742,13 @@ void explain_stmt::out(std::ostream &out) {
out << "with (";
switch(d6()) {
case 1:
out << "arity, join_impls";
out << "arity, join_impls, humanized_exprs";
break;
case 2:
out << "arity, join_impls, keys, types";
out << "arity, join_impls, keys, types, humanized_exprs";
break;
case 3:
out << "keys, types";
out << "keys, types, humanized_exprs";
break;
case 4:
out << "keys";
Expand All @@ -775,5 +775,8 @@ void explain_stmt::out(std::ostream &out) {
if (for_supported) {
out << "for ";
}
if(with_supported && d6() > 3) {
out << "create materialized view mv as ";
}
out << *q;
}

0 comments on commit 48ff8d6

Please sign in to comment.