diff --git a/src/sql/src/func.rs b/src/sql/src/func.rs index 6b98ec72be9ec..24a29e6c327a3 100644 --- a/src/sql/src/func.rs +++ b/src/sql/src/func.rs @@ -27,7 +27,7 @@ use crate::ast::{SelectStatement, Statement}; use crate::catalog::{CatalogType, TypeCategory, TypeReference}; use crate::names::{self, ResolvedItemName}; use crate::plan::error::PlanError; -use crate::plan::expr::{ +use crate::plan::hir::{ AggregateFunc, BinaryFunc, CoercibleScalarExpr, CoercibleScalarType, ColumnOrder, HirRelationExpr, HirScalarExpr, ScalarWindowFunc, TableFunc, UnaryFunc, UnmaterializableFunc, ValueWindowFunc, VariadicFunc, diff --git a/src/sql/src/plan.rs b/src/sql/src/plan.rs index 7558f5f0110f5..54154a2a6883c 100644 --- a/src/sql/src/plan.rs +++ b/src/sql/src/plan.rs @@ -87,7 +87,7 @@ use crate::names::{ pub(crate) mod error; pub(crate) mod explain; -pub(crate) mod expr; +pub(crate) mod hir; pub(crate) mod literal; pub(crate) mod lowering; pub(crate) mod notice; @@ -106,7 +106,7 @@ use crate::plan::statement::ddl::ClusterAlterUntilReadyOptionExtracted; use crate::plan::with_options::OptionalDuration; pub use error::PlanError; pub use explain::normalize_subqueries; -pub use expr::{ +pub use hir::{ AggregateExpr, CoercibleScalarExpr, Hir, HirRelationExpr, HirScalarExpr, JoinKind, WindowExprType, }; diff --git a/src/sql/src/plan/expr.rs b/src/sql/src/plan/hir.rs similarity index 99% rename from src/sql/src/plan/expr.rs rename to src/sql/src/plan/hir.rs index e191855e221e9..687b028f418ee 100644 --- a/src/sql/src/plan/expr.rs +++ b/src/sql/src/plan/hir.rs @@ -7,10 +7,9 @@ // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0. -//! This file houses a representation of a SQL plan that is parallel to that found in -//! src/expr/relation/mod.rs, but represents an earlier phase of planning. It's structurally very -//! similar to that file, with some differences which are noted below. It gets turned into that -//! representation via a call to lower(). +//! This file houses HIR, a representation of a SQL plan that is parallel to MIR, but represents +//! an earlier phase of planning. It's structurally very similar to MIR, with some differences +//! which are noted below. It gets turned into MIR via a call to lower(). use std::collections::{BTreeMap, BTreeSet}; use std::fmt::{Display, Formatter}; diff --git a/src/sql/src/plan/lowering.rs b/src/sql/src/plan/lowering.rs index c4230ce3839fd..8ca869a598805 100644 --- a/src/sql/src/plan/lowering.rs +++ b/src/sql/src/plan/lowering.rs @@ -40,7 +40,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::iter::repeat; use crate::optimizer_metrics::OptimizerMetrics; -use crate::plan::expr::{ +use crate::plan::hir::{ AggregateExpr, ColumnOrder, ColumnRef, HirRelationExpr, HirScalarExpr, JoinKind, WindowExprType, }; use crate::plan::{transform_hir, PlanError}; diff --git a/src/sql/src/plan/lowering/variadic_left.rs b/src/sql/src/plan/lowering/variadic_left.rs index 5962654c7e361..2513384f8f12f 100644 --- a/src/sql/src/plan/lowering/variadic_left.rs +++ b/src/sql/src/plan/lowering/variadic_left.rs @@ -11,7 +11,7 @@ use itertools::Itertools; use mz_expr::{MirRelationExpr, MirScalarExpr}; use mz_ore::soft_assert_eq_or_log; -use crate::plan::expr::{HirRelationExpr, HirScalarExpr}; +use crate::plan::hir::{HirRelationExpr, HirScalarExpr}; use crate::plan::lowering::{ColumnMap, Context, CteMap}; use crate::plan::PlanError; diff --git a/src/sql/src/plan/query.rs b/src/sql/src/plan/query.rs index d79842eca366a..2778774acf4cb 100644 --- a/src/sql/src/plan/query.rs +++ b/src/sql/src/plan/query.rs @@ -82,7 +82,7 @@ use crate::names::{ }; use crate::normalize; use crate::plan::error::PlanError; -use crate::plan::expr::{ +use crate::plan::hir::{ AbstractColumnType, AbstractExpr, AggregateExpr, AggregateFunc, AggregateWindowExpr, BinaryFunc, CoercibleScalarExpr, CoercibleScalarType, ColumnOrder, ColumnRef, Hir, HirRelationExpr, HirScalarExpr, JoinKind, ScalarWindowExpr, ScalarWindowFunc, UnaryFunc, diff --git a/src/sql/src/plan/scope.rs b/src/sql/src/plan/scope.rs index 54cd00839fc74..6e99c0cb91b03 100644 --- a/src/sql/src/plan/scope.rs +++ b/src/sql/src/plan/scope.rs @@ -50,7 +50,7 @@ use mz_repr::ColumnName; use crate::ast::Expr; use crate::names::{Aug, PartialItemName}; use crate::plan::error::PlanError; -use crate::plan::expr::ColumnRef; +use crate::plan::hir::ColumnRef; use crate::plan::plan_utils::JoinSide; #[derive(Debug, Clone)] diff --git a/src/sql/src/plan/transform_hir.rs b/src/sql/src/plan/transform_hir.rs index e2f0b8f29f7e7..6545475f18c16 100644 --- a/src/sql/src/plan/transform_hir.rs +++ b/src/sql/src/plan/transform_hir.rs @@ -20,7 +20,7 @@ use mz_expr::{ColumnOrder, UnaryFunc, VariadicFunc}; use mz_ore::stack::RecursionLimitError; use mz_repr::{ColumnName, ColumnType, RelationType, ScalarType}; -use crate::plan::expr::{ +use crate::plan::hir::{ AbstractExpr, AggregateFunc, AggregateWindowExpr, ColumnRef, HirRelationExpr, HirScalarExpr, ValueWindowExpr, ValueWindowFunc, WindowExpr, }; diff --git a/src/sql/src/plan/typeconv.rs b/src/sql/src/plan/typeconv.rs index 3e7452faf0a45..beba28e26dd35 100644 --- a/src/sql/src/plan/typeconv.rs +++ b/src/sql/src/plan/typeconv.rs @@ -23,7 +23,7 @@ use mz_repr::{ColumnName, ColumnType, Datum, RelationType, ScalarBaseType, Scala use crate::catalog::TypeCategory; use crate::plan::error::PlanError; -use crate::plan::expr::{ +use crate::plan::hir::{ AbstractColumnType, CoercibleScalarExpr, CoercibleScalarType, ColumnRef, HirScalarExpr, UnaryFunc, }; diff --git a/src/sql/src/pure/postgres.rs b/src/sql/src/pure/postgres.rs index 7e467057920bd..27d38bc6ce68d 100644 --- a/src/sql/src/pure/postgres.rs +++ b/src/sql/src/pure/postgres.rs @@ -29,7 +29,7 @@ use tokio_postgres::Client; use crate::names::{Aug, ResolvedItemName}; use crate::normalize; -use crate::plan::expr::ColumnRef; +use crate::plan::hir::ColumnRef; use crate::plan::typeconv::{plan_cast, CastContext}; use crate::plan::{ ExprContext, HirScalarExpr, PlanError, QueryContext, QueryLifetime, Scope, StatementContext,