@@ -6,18 +6,15 @@ use std::sync::Arc;
6
6
7
7
use arrow_arith:: boolean:: { and, is_null, not, or} ;
8
8
use arrow_arith:: numeric:: { add, div, mul, sub} ;
9
- use arrow_array:: RecordBatch as ColumnarBatch ;
10
9
use arrow_array:: {
11
10
Array , ArrayRef , BinaryArray , BooleanArray , Date32Array , Decimal128Array , Float32Array ,
12
11
Int32Array , RecordBatch , StringArray , TimestampMicrosecondArray ,
13
12
} ;
14
13
use arrow_ord:: cmp:: { eq, gt, gt_eq, lt, lt_eq, neq} ;
15
14
16
- use super :: ExpressionEvaluator ;
17
15
use crate :: kernel:: error:: { DeltaResult , Error } ;
18
16
use crate :: kernel:: expressions:: { scalars:: Scalar , Expression } ;
19
17
use crate :: kernel:: expressions:: { BinaryOperator , UnaryOperator } ;
20
- use crate :: kernel:: schema:: SchemaRef ;
21
18
22
19
// TODO leverage scalars / Datum
23
20
@@ -43,7 +40,10 @@ impl Scalar {
43
40
}
44
41
}
45
42
46
- fn evaluate_expression ( expression : & Expression , batch : & RecordBatch ) -> DeltaResult < ArrayRef > {
43
+ pub ( crate ) fn evaluate_expression (
44
+ expression : & Expression ,
45
+ batch : & RecordBatch ,
46
+ ) -> DeltaResult < ArrayRef > {
47
47
match expression {
48
48
Expression :: Literal ( scalar) => Ok ( scalar. to_array ( batch. num_rows ( ) ) ) ,
49
49
Expression :: Column ( name) => batch
@@ -166,20 +166,6 @@ fn evaluate_expression(expression: &Expression, batch: &RecordBatch) -> DeltaRes
166
166
}
167
167
}
168
168
169
- #[ derive( Debug ) ]
170
- /// Expression evaluator based on arrow compute kernels.
171
- pub struct ArrowExpressionEvaluator {
172
- _input_schema : SchemaRef ,
173
- expression : Box < Expression > ,
174
- }
175
-
176
- impl ExpressionEvaluator for ArrowExpressionEvaluator {
177
- fn evaluate ( & self , batch : & ColumnarBatch ) -> DeltaResult < ColumnarBatch > {
178
- let _result = evaluate_expression ( & self . expression , batch) ?;
179
- todo ! ( )
180
- }
181
- }
182
-
183
169
#[ cfg( test) ]
184
170
mod tests {
185
171
use super :: * ;
0 commit comments