Skip to content

Commit

Permalink
add it into optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed Mar 6, 2023
1 parent c1d38b5 commit 105a33e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion datafusion/core/tests/sqllogictests/test_files/order.slt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ SELECT arrow_typeof(c1), arrow_typeof(c2), arrow_typeof(c3) FROM test LIMIT 1;
----
Int32 Int64 Boolean


query II
SELECT c1, c2 FROM test ORDER BY c1 DESC, c2 ASC
----
Expand Down Expand Up @@ -155,6 +154,9 @@ SELECT c1, c2 FROM test ORDER BY c1 DESC, c2 ASC
0 9
0 10

query error DataFusion error: SQL error: ParserError("Expected an SQL statement, found: #")
# eliminate duplicated sorted expr
SELECT c1, c2 FROM test ORDER BY c1, c2, c1


# sort_empty
Expand Down
2 changes: 2 additions & 0 deletions datafusion/optimizer/src/optimizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use crate::common_subexpr_eliminate::CommonSubexprEliminate;
use crate::decorrelate_where_exists::DecorrelateWhereExists;
use crate::decorrelate_where_in::DecorrelateWhereIn;
use crate::eliminate_cross_join::EliminateCrossJoin;
use crate::eliminate_duplicated_expr::EliminateDuplicatedExpr;
use crate::eliminate_filter::EliminateFilter;
use crate::eliminate_limit::EliminateLimit;
use crate::eliminate_outer_join::EliminateOuterJoin;
Expand Down Expand Up @@ -221,6 +222,7 @@ impl Optimizer {
Arc::new(SimplifyExpressions::new()),
Arc::new(MergeProjection::new()),
Arc::new(RewriteDisjunctivePredicate::new()),
Arc::new(EliminateDuplicatedExpr::new()),
Arc::new(EliminateFilter::new()),
Arc::new(EliminateCrossJoin::new()),
Arc::new(CommonSubexprEliminate::new()),
Expand Down

0 comments on commit 105a33e

Please sign in to comment.