Skip to content

Commit

Permalink
Merge pull request #31142 from ggevay/hir-refactor-minor-2
Browse files Browse the repository at this point in the history
Rename `sql/src/plan/expr.rs` to `hir.rs`
  • Loading branch information
ggevay authored Jan 22, 2025
2 parents 5e5a750 + 63be35f commit 32434f7
Showing 10 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/sql/src/func.rs
Original file line number Diff line number Diff line change
@@ -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,
4 changes: 2 additions & 2 deletions src/sql/src/plan.rs
Original file line number Diff line number Diff line change
@@ -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,
};
7 changes: 3 additions & 4 deletions src/sql/src/plan/expr.rs → src/sql/src/plan/hir.rs
Original file line number Diff line number Diff line change
@@ -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};
2 changes: 1 addition & 1 deletion src/sql/src/plan/lowering.rs
Original file line number Diff line number Diff line change
@@ -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};
2 changes: 1 addition & 1 deletion src/sql/src/plan/lowering/variadic_left.rs
Original file line number Diff line number Diff line change
@@ -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;

2 changes: 1 addition & 1 deletion src/sql/src/plan/query.rs
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion src/sql/src/plan/scope.rs
Original file line number Diff line number Diff line change
@@ -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)]
2 changes: 1 addition & 1 deletion src/sql/src/plan/transform_hir.rs
Original file line number Diff line number Diff line change
@@ -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,
};
2 changes: 1 addition & 1 deletion src/sql/src/plan/typeconv.rs
Original file line number Diff line number Diff line change
@@ -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,
};
2 changes: 1 addition & 1 deletion src/sql/src/pure/postgres.rs
Original file line number Diff line number Diff line change
@@ -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,

0 comments on commit 32434f7

Please sign in to comment.