Skip to content

Commit

Permalink
Refactor: move simplify_expression.rs and expr_simplifier.rs to a…
Browse files Browse the repository at this point in the history
… new mod `simplify_expressions` (#3951)

* create mod for expr_simpl

Signed-off-by: remzi <13716567376yh@gmail.com>

* move utility to utils

Signed-off-by: remzi <13716567376yh@gmail.com>

* create context mod

Signed-off-by: remzi <13716567376yh@gmail.com>

* add docs for context

Signed-off-by: remzi <13716567376yh@gmail.com>

* move constEvalutor to expr_simplififer

Signed-off-by: remzi <13716567376yh@gmail.com>

* move simplifier to expr_simplifier

Signed-off-by: remzi <13716567376yh@gmail.com>

* fix lints

Signed-off-by: remzi <13716567376yh@gmail.com>

* fix merge conflict

Signed-off-by: remzi <13716567376yh@gmail.com>

Signed-off-by: remzi <13716567376yh@gmail.com>
  • Loading branch information
HaoYang670 authored Oct 26, 2022
1 parent 784f10b commit 10e64dc
Show file tree
Hide file tree
Showing 10 changed files with 1,916 additions and 1,840 deletions.
2 changes: 1 addition & 1 deletion datafusion-examples/examples/expr_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use datafusion::arrow::datatypes::{DataType, Field, Schema, TimeUnit};
use datafusion::error::Result;
use datafusion::optimizer::expr_simplifier::{ExprSimplifier, SimplifyContext};
use datafusion::optimizer::simplify_expressions::{ExprSimplifier, SimplifyContext};
use datafusion::physical_expr::execution_props::ExecutionProps;
use datafusion::prelude::*;
use datafusion_common::{ScalarValue, ToDFSchema};
Expand Down
2 changes: 1 addition & 1 deletion datafusion/core/tests/simplification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use arrow::datatypes::{DataType, Field, Schema};
use datafusion::common::DFSchema;
use datafusion::{error::Result, execution::context::ExecutionProps, prelude::*};
use datafusion_expr::{Expr, ExprSchemable};
use datafusion_optimizer::expr_simplifier::{ExprSimplifier, SimplifyInfo};
use datafusion_optimizer::simplify_expressions::{ExprSimplifier, SimplifyInfo};

/// In order to simplify expressions, DataFusion must have information
/// about the expressions.
Expand Down
4 changes: 3 additions & 1 deletion datafusion/expr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ pub use accumulator::{Accumulator, AggregateState};
pub use aggregate_function::AggregateFunction;
pub use built_in_function::BuiltinScalarFunction;
pub use columnar_value::{ColumnarValue, NullColumnarValue};
pub use expr::{Between, BinaryExpr, Case, Expr, GetIndexedField, GroupingSet, Like};
pub use expr::{
Between, BinaryExpr, Case, Cast, Expr, GetIndexedField, GroupingSet, Like,
};
pub use expr_fn::*;
pub use expr_schema::ExprSchemable;
pub use function::{
Expand Down
315 changes: 0 additions & 315 deletions datafusion/optimizer/src/expr_simplifier.rs

This file was deleted.

1 change: 0 additions & 1 deletion datafusion/optimizer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub mod decorrelate_where_exists;
pub mod decorrelate_where_in;
pub mod eliminate_filter;
pub mod eliminate_limit;
pub mod expr_simplifier;
pub mod filter_null_join_keys;
pub mod filter_push_down;
pub mod inline_table_scan;
Expand Down
Loading

0 comments on commit 10e64dc

Please sign in to comment.