Skip to content

Commit

Permalink
sql: remove QGM code and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aalexandrov committed Jan 13, 2023
1 parent 4cc0987 commit b1e5db7
Show file tree
Hide file tree
Showing 37 changed files with 0 additions and 9,663 deletions.
10 changes: 0 additions & 10 deletions src/adapter/src/error.rs
Expand Up @@ -22,7 +22,6 @@ use mz_ore::str::StrExt;
use mz_repr::explain_new::ExplainError;
use mz_repr::NotNullViolation;
use mz_sql::plan::PlanError;
use mz_sql::query_model::QGMError;
use mz_storage_client::controller::StorageError;
use mz_transform::TransformError;

Expand Down Expand Up @@ -109,8 +108,6 @@ pub enum AdapterError {
PlanError(PlanError),
/// The named prepared statement already exists.
PreparedStatementExists(String),
/// An error occurred in the QGM stage of the optimizer.
QGM(QGMError),
/// The transaction is in read-only mode.
ReadOnlyTransaction,
/// The specified session parameter is read-only.
Expand Down Expand Up @@ -401,7 +398,6 @@ impl fmt::Display for AdapterError {
AdapterError::PreparedStatementExists(name) => {
write!(f, "prepared statement {} already exists", name.quoted())
}
AdapterError::QGM(e) => e.fmt(f),
AdapterError::ReadOnlyTransaction => f.write_str("transaction in read-only mode"),
AdapterError::ReadOnlyParameter(p) => {
write!(f, "parameter {} cannot be changed", p.name().quoted())
Expand Down Expand Up @@ -552,12 +548,6 @@ impl From<PlanError> for AdapterError {
}
}

impl From<QGMError> for AdapterError {
fn from(e: QGMError) -> AdapterError {
AdapterError::QGM(e)
}
}

impl From<TransformError> for AdapterError {
fn from(e: TransformError) -> AdapterError {
AdapterError::Transform(e)
Expand Down
1 change: 0 additions & 1 deletion src/adapter/src/explain_new/mod.rs
Expand Up @@ -33,7 +33,6 @@ pub(crate) mod hir;
pub(crate) mod lir;
pub(crate) mod mir;
pub(crate) mod optimizer_trace;
pub(crate) mod qgm;

/// Newtype struct for wrapping types that should
/// implement the [`mz_repr::explain_new::Explain`] trait.
Expand Down
46 changes: 0 additions & 46 deletions src/adapter/src/explain_new/qgm/dot.rs

This file was deleted.

37 changes: 0 additions & 37 deletions src/adapter/src/explain_new/qgm/mod.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/pgwire/src/message.rs
Expand Up @@ -347,7 +347,6 @@ impl ErrorResponse {
AdapterError::OperationRequiresTransaction(_) => SqlState::NO_ACTIVE_SQL_TRANSACTION,
AdapterError::PlanError(_) => SqlState::INTERNAL_ERROR,
AdapterError::PreparedStatementExists(_) => SqlState::DUPLICATE_PSTATEMENT,
AdapterError::QGM(_) => SqlState::INTERNAL_ERROR,
AdapterError::ReadOnlyTransaction => SqlState::READ_ONLY_SQL_TRANSACTION,
AdapterError::ReadOnlyParameter(_) => SqlState::CANT_CHANGE_RUNTIME_PARAM,
AdapterError::ReadWriteUnavailable => SqlState::INVALID_TRANSACTION_STATE,
Expand Down
1 change: 0 additions & 1 deletion src/sql-parser/src/keywords.txt
Expand Up @@ -140,7 +140,6 @@ From
Full
Fullname
Generator
Graph
Greatest
Group
Groups
Expand Down
7 changes: 0 additions & 7 deletions src/sql-parser/tests/testdata/explain
Expand Up @@ -103,13 +103,6 @@ EXPLAIN TIMESTAMP AS TEXT FOR SELECT 1
=>
Explain(ExplainStatement { stage: Timestamp, config_flags: [], format: Text, explainee: Query(Query { ctes: Simple([]), body: Select(Select { distinct: None, projection: [Expr { expr: Value(Number("1")), alias: None }], from: [], selection: None, group_by: [], having: None, options: [] }), order_by: [], limit: None, offset: None }) })

parse-statement
EXPLAIN OPTIMIZED QUERY GRAPH WITH (monotonicity, types) AS TEXT FOR VIEW foo
----
EXPLAIN OPTIMIZED QUERY GRAPH WITH(monotonicity, types) AS TEXT FOR VIEW foo
=>
Explain(ExplainStatement { stage: OptimizedQueryGraph, config_flags: [Ident("monotonicity"), Ident("types")], format: Text, explainee: View(Name(UnresolvedObjectName([Ident("foo")]))) })

parse-statement
EXPLAIN AS JSON SELECT * FROM foo
----
Expand Down
1 change: 0 additions & 1 deletion src/sql/src/lib.rs
Expand Up @@ -173,4 +173,3 @@ pub mod normalize;
pub mod parse;
pub mod plan;
pub mod pure;
pub mod query_model;
9 changes: 0 additions & 9 deletions src/sql/src/plan/error.rs
Expand Up @@ -34,7 +34,6 @@ use crate::names::PartialObjectName;
use crate::names::ResolvedObjectName;
use crate::plan::plan_utils::JoinSide;
use crate::plan::scope::ScopeItem;
use crate::query_model::QGMError;

#[derive(Clone, Debug)]
pub enum PlanError {
Expand Down Expand Up @@ -83,7 +82,6 @@ pub enum PlanError {
InvalidSecret(ResolvedObjectName),
InvalidTemporarySchema,
Parser(ParserError),
Qgm(QGMError),
DropViewOnMaterializedView(String),
DropSubsource {
subsource: String,
Expand Down Expand Up @@ -319,7 +317,6 @@ impl fmt::Display for PlanError {
Self::Unstructured(e) => write!(f, "{}", e),
Self::InvalidObject(i) => write!(f, "{} is not a database object", i.full_name_str()),
Self::InvalidSecret(i) => write!(f, "{} is not a secret", i.full_name_str()),
Self::Qgm(e) => e.fmt(f),
Self::InvalidTemporarySchema => {
write!(f, "cannot create temporary item in non-temporary schema")
}
Expand Down Expand Up @@ -455,12 +452,6 @@ impl From<ParserError> for PlanError {
}
}

impl From<QGMError> for PlanError {
fn from(e: QGMError) -> PlanError {
PlanError::Qgm(e)
}
}

struct ColumnDisplay<'a> {
table: &'a Option<PartialObjectName>,
column: &'a ColumnName,
Expand Down
38 changes: 0 additions & 38 deletions src/sql/src/query_model/README.md

This file was deleted.

0 comments on commit b1e5db7

Please sign in to comment.