Skip to content

Commit 986a939

Browse files
authored
Merge branch 'main' into dev-refine-mod
2 parents 6cd46f1 + 4943098 commit 986a939

29 files changed

+131
-1808
lines changed

src/query/legacy-planners/src/lib.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// limitations under the License.
1414

1515
mod plan_delete;
16-
mod plan_empty;
1716
mod plan_expression;
1817
mod plan_expression_action;
1918
mod plan_expression_chain;
@@ -22,7 +21,6 @@ mod plan_expression_common;
2221
mod plan_expression_function;
2322
mod plan_expression_literal;
2423
mod plan_expression_monotonicity;
25-
mod plan_expression_sort;
2624
mod plan_expression_validator;
2725
mod plan_expression_visitor;
2826
mod plan_node_extras;
@@ -31,33 +29,16 @@ mod plan_node_stage_table;
3129
mod plan_node_statistics;
3230
mod plan_partition;
3331
mod plan_read_datasource;
34-
mod plan_remote;
3532
mod plan_setting;
3633
mod plan_sink;
3734
mod plan_table_recluster;
3835

3936
pub use plan_delete::DeletePlan;
40-
pub use plan_empty::EmptyPlan;
4137
pub use plan_expression::Expression;
4238
pub use plan_expression::Expressions;
4339
pub use plan_expression_action::*;
4440
pub use plan_expression_chain::ExpressionChain;
4541
pub use plan_expression_column::col;
46-
pub use plan_expression_common::expand_aggregate_arg_exprs;
47-
pub use plan_expression_common::expand_wildcard;
48-
pub use plan_expression_common::expr_as_column_expr;
49-
pub use plan_expression_common::extract_aliases;
50-
pub use plan_expression_common::find_aggregate_exprs;
51-
pub use plan_expression_common::find_aggregate_exprs_in_expr;
52-
pub use plan_expression_common::find_column_exprs;
53-
pub use plan_expression_common::find_columns_not_satisfy_exprs;
54-
pub use plan_expression_common::find_window_exprs;
55-
pub use plan_expression_common::find_window_exprs_in_expr;
56-
pub use plan_expression_common::rebase_expr;
57-
pub use plan_expression_common::rebase_expr_from_input;
58-
pub use plan_expression_common::resolve_aliases_to_exprs;
59-
pub use plan_expression_common::sort_to_inner_expr;
60-
pub use plan_expression_common::unwrap_alias_exprs;
6142
pub use plan_expression_common::RequireColumnsVisitor;
6243
pub use plan_expression_function::add;
6344
pub use plan_expression_function::avg;
@@ -69,8 +50,6 @@ pub use plan_expression_function::sum;
6950
pub use plan_expression_literal::lit;
7051
pub use plan_expression_literal::lit_null;
7152
pub use plan_expression_monotonicity::ExpressionMonotonicityVisitor;
72-
pub use plan_expression_sort::sort;
73-
pub use plan_expression_validator::validate_clustering;
7453
pub use plan_expression_validator::validate_expression;
7554
pub use plan_expression_validator::validate_function_arg;
7655
pub use plan_expression_visitor::ExpressionVisitor;
@@ -86,9 +65,6 @@ pub use plan_partition::PartInfoPtr;
8665
pub use plan_partition::Partitions;
8766
pub use plan_read_datasource::ReadDataSourcePlan;
8867
pub use plan_read_datasource::SourceInfo;
89-
pub use plan_remote::RemotePlan;
90-
pub use plan_remote::V1RemotePlan;
91-
pub use plan_remote::V2RemotePlan;
9268
pub use plan_setting::SettingPlan;
9369
pub use plan_setting::VarValue;
9470
pub use plan_sink::SINK_SCHEMA;

src/query/legacy-planners/src/plan_empty.rs

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/query/legacy-planners/src/plan_expression.rs

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use common_exception::ErrorCode;
2020
use common_exception::Result;
2121
use common_functions::aggregates::AggregateFunctionFactory;
2222
use common_functions::aggregates::AggregateFunctionRef;
23-
use common_functions::window::WindowFrame;
2423
use once_cell::sync::Lazy;
2524

2625
use crate::plan_expression_common::ExpressionDataTypeVisitor;
@@ -75,22 +74,6 @@ pub enum Expression {
7574
args: Vec<Expression>,
7675
},
7776

78-
/// WindowFunction
79-
WindowFunction {
80-
/// operation performed
81-
op: String,
82-
/// params
83-
params: Vec<DataValue>,
84-
/// arguments
85-
args: Vec<Expression>,
86-
/// partition by
87-
partition_by: Vec<Expression>,
88-
/// order by
89-
order_by: Vec<Expression>,
90-
/// window frame
91-
window_frame: Option<WindowFrame>,
92-
},
93-
9477
/// A sort expression, that can be used to sort values.
9578
Sort {
9679
/// The expression to sort on
@@ -226,10 +209,6 @@ impl Expression {
226209
.map(|return_type| DataField::new(&name, return_type))
227210
}
228211

229-
pub fn nullable(&self, input_schema: &DataSchemaRef) -> Result<bool> {
230-
Ok(self.to_data_type(input_schema)?.is_nullable())
231-
}
232-
233212
pub fn to_data_type(&self, input_schema: &DataSchemaRef) -> Result<DataTypeImpl> {
234213
let visitor = ExpressionDataTypeVisitor::create(input_schema.clone());
235214
visitor.visit(self)?.finalize()
@@ -348,53 +327,6 @@ impl fmt::Debug for Expression {
348327
Ok(())
349328
}
350329

351-
Expression::WindowFunction {
352-
op,
353-
params,
354-
args,
355-
partition_by,
356-
order_by,
357-
window_frame,
358-
} => {
359-
let args_column_name = args.iter().map(Expression::column_name).collect::<Vec<_>>();
360-
let params_name = params
361-
.iter()
362-
.map(|v| DataValue::custom_display(v, true))
363-
.collect::<Vec<_>>();
364-
365-
if params.is_empty() {
366-
write!(f, "{}", op)?;
367-
} else {
368-
write!(f, "{}({})", op, params_name.join(", "))?;
369-
}
370-
371-
write!(f, "({})", args_column_name.join(","))?;
372-
373-
write!(f, " OVER(")?;
374-
if !partition_by.is_empty() {
375-
write!(f, "PARTITION BY {:?}", partition_by)?;
376-
}
377-
if !order_by.is_empty() {
378-
if !partition_by.is_empty() {
379-
write!(f, " ")?;
380-
}
381-
write!(f, "ORDER BY {:?}", order_by)?;
382-
}
383-
if let Some(window_frame) = window_frame {
384-
if !partition_by.is_empty() || !order_by.is_empty() {
385-
write!(f, " ")?;
386-
}
387-
write!(
388-
f,
389-
"{} BETWEEN {} AND {}",
390-
window_frame.units, window_frame.start_bound, window_frame.end_bound
391-
)?;
392-
}
393-
write!(f, ")")?;
394-
395-
Ok(())
396-
}
397-
398330
Expression::Sort { expr, .. } => write!(f, "{:?}", expr),
399331
Expression::Wildcard => write!(f, "*"),
400332
Expression::Cast {

src/query/legacy-planners/src/plan_expression_chain.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ impl ExpressionChain {
179179
));
180180
}
181181

182-
Expression::WindowFunction { .. } => {}
183-
184182
Expression::Wildcard | Expression::Sort { .. } => {}
185183

186184
Expression::Cast {

0 commit comments

Comments
 (0)