Skip to content

Commit c943e00

Browse files
authored
Replace function from_proto_binary_op from upstream (#298)
1 parent 58c2ccc commit c943e00

File tree

2 files changed

+3
-36
lines changed

2 files changed

+3
-36
lines changed

ballista/rust/core/src/serde/mod.rs

+1-35
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use crate::{error::BallistaError, serde::scheduler::Action as BallistaAction};
2222
use arrow_flight::sql::ProstMessageExt;
2323
use datafusion::execution::runtime_env::RuntimeEnv;
24-
use datafusion::logical_plan::{FunctionRegistry, Operator};
24+
use datafusion::logical_plan::FunctionRegistry;
2525
use datafusion::physical_plan::join_utils::JoinSide;
2626
use datafusion::physical_plan::ExecutionPlan;
2727
use datafusion_proto::logical_plan::{
@@ -209,40 +209,6 @@ macro_rules! convert_box_required {
209209
}};
210210
}
211211

212-
pub(crate) fn from_proto_binary_op(op: &str) -> Result<Operator, BallistaError> {
213-
match op {
214-
"And" => Ok(Operator::And),
215-
"Or" => Ok(Operator::Or),
216-
"Eq" => Ok(Operator::Eq),
217-
"NotEq" => Ok(Operator::NotEq),
218-
"LtEq" => Ok(Operator::LtEq),
219-
"Lt" => Ok(Operator::Lt),
220-
"Gt" => Ok(Operator::Gt),
221-
"GtEq" => Ok(Operator::GtEq),
222-
"Plus" => Ok(Operator::Plus),
223-
"Minus" => Ok(Operator::Minus),
224-
"Multiply" => Ok(Operator::Multiply),
225-
"Divide" => Ok(Operator::Divide),
226-
"Modulo" => Ok(Operator::Modulo),
227-
"Like" => Ok(Operator::Like),
228-
"NotLike" => Ok(Operator::NotLike),
229-
"IsDistinctFrom" => Ok(Operator::IsDistinctFrom),
230-
"IsNotDistinctFrom" => Ok(Operator::IsNotDistinctFrom),
231-
"BitwiseAnd" => Ok(Operator::BitwiseAnd),
232-
"BitwiseOr" => Ok(Operator::BitwiseOr),
233-
"BitwiseShiftLeft" => Ok(Operator::BitwiseShiftLeft),
234-
"BitwiseShiftRight" => Ok(Operator::BitwiseShiftRight),
235-
"RegexIMatch" => Ok(Operator::RegexIMatch),
236-
"RegexMatch" => Ok(Operator::RegexMatch),
237-
"RegexNotIMatch" => Ok(Operator::RegexNotIMatch),
238-
"RegexNotMatch" => Ok(Operator::RegexNotMatch),
239-
"StringConcat" => Ok(Operator::StringConcat),
240-
other => Err(proto_error(format!(
241-
"Unsupported binary operator '{:?}'",
242-
other
243-
))),
244-
}
245-
}
246212
impl From<protobuf::JoinSide> for JoinSide {
247213
fn from(t: protobuf::JoinSide) -> Self {
248214
match t {

ballista/rust/core/src/serde/physical_plan/from_proto.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ use datafusion::physical_plan::{
3939
functions, Partitioning,
4040
};
4141
use datafusion::physical_plan::{ColumnStatistics, PhysicalExpr, Statistics};
42+
use datafusion_proto::from_proto::from_proto_binary_op;
4243
use object_store::path::Path;
4344
use object_store::ObjectMeta;
4445

4546
use crate::serde::protobuf::physical_expr_node::ExprType;
4647

4748
use crate::convert_required;
4849
use crate::error::BallistaError;
49-
use crate::serde::{from_proto_binary_op, proto_error, protobuf};
50+
use crate::serde::{proto_error, protobuf};
5051

5152
impl From<&protobuf::PhysicalColumn> for Column {
5253
fn from(c: &protobuf::PhysicalColumn) -> Column {

0 commit comments

Comments
 (0)