Skip to content

Commit 8a3e15e

Browse files
committed
Remove not used expression functions
Signed-off-by: Xuanwo <github@xuanwo.io>
1 parent 288c0a9 commit 8a3e15e

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ pub use plan_expression_function::sum;
5151
pub use plan_expression_literal::lit;
5252
pub use plan_expression_literal::lit_null;
5353
pub use plan_expression_monotonicity::ExpressionMonotonicityVisitor;
54-
pub use plan_expression_validator::validate_clustering;
5554
pub use plan_expression_validator::validate_expression;
5655
pub use plan_expression_validator::validate_function_arg;
5756
pub use plan_expression_visitor::ExpressionVisitor;

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

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -110,35 +110,3 @@ pub fn validate_expression(expr: &Expression, schema: &DataSchemaRef) -> Result<
110110
None => Ok(()),
111111
}
112112
}
113-
114-
fn check_deterministic(op: &str) -> Result<()> {
115-
let features = FunctionFactory::instance().get_features(op)?;
116-
if !features.is_deterministic {
117-
return Err(ErrorCode::InvalidClusterKeys(format!(
118-
"Function `{}` is not valid for clustering",
119-
op
120-
)));
121-
}
122-
Ok(())
123-
}
124-
125-
pub fn validate_clustering(expr: &Expression) -> Result<()> {
126-
let validator = ExpressionValidator::new(&|expr: &Expression| match expr {
127-
Expression::Literal { .. } => Ok(()),
128-
Expression::Column { .. } => Ok(()),
129-
Expression::Cast { .. } => Ok(()),
130-
Expression::UnaryExpression { op, .. } => check_deterministic(op),
131-
Expression::BinaryExpression { op, .. } => check_deterministic(op),
132-
Expression::ScalarFunction { op, .. } => check_deterministic(op),
133-
_ => Err(ErrorCode::InvalidClusterKeys(format!(
134-
"Function `{}` is not valid for clustering",
135-
expr.column_name()
136-
))),
137-
});
138-
139-
let validator = expr.accept(validator)?;
140-
match validator.error {
141-
Some(err) => Err(err),
142-
None => Ok(()),
143-
}
144-
}

0 commit comments

Comments
 (0)