Skip to content
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

Rename sql/src/plan/expr.rs to hir.rs #31142

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sql/src/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/sql/src/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
};
Expand Down
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
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/sql/src/plan/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/sql/src/plan/lowering/variadic_left.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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