Skip to content

Commit 23967d7

Browse files
chore[vortex-array]: rename reduce_children -> reduce (#5375)
Signed-off-by: Joe Isaacs <[email protected]>
1 parent d17d54f commit 23967d7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

vortex-array/src/array/operator.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub trait ArrayOperator: 'static + Send + Sync {
2727
fn execute_batch(&self, selection: &Mask, ctx: &mut dyn ExecutionCtx) -> VortexResult<Vector>;
2828

2929
/// Optimize the array by running the optimization rules.
30-
fn reduce_children(&self) -> VortexResult<Option<ArrayRef>>;
30+
fn reduce(&self) -> VortexResult<Option<ArrayRef>>;
3131

3232
/// Optimize the array by pushing down a parent array.
3333
fn reduce_parent(&self, parent: &ArrayRef, child_idx: usize) -> VortexResult<Option<ArrayRef>>;
@@ -48,8 +48,8 @@ impl ArrayOperator for Arc<dyn Array> {
4848
self.as_ref().execute_batch(selection, ctx)
4949
}
5050

51-
fn reduce_children(&self) -> VortexResult<Option<ArrayRef>> {
52-
self.as_ref().reduce_children()
51+
fn reduce(&self) -> VortexResult<Option<ArrayRef>> {
52+
self.as_ref().reduce()
5353
}
5454

5555
fn reduce_parent(&self, parent: &ArrayRef, child_idx: usize) -> VortexResult<Option<ArrayRef>> {
@@ -96,8 +96,8 @@ impl<V: VTable> ArrayOperator for ArrayAdapter<V> {
9696
Ok(vector)
9797
}
9898

99-
fn reduce_children(&self) -> VortexResult<Option<ArrayRef>> {
100-
<V::OperatorVTable as OperatorVTable<V>>::reduce_children(&self.0)
99+
fn reduce(&self) -> VortexResult<Option<ArrayRef>> {
100+
<V::OperatorVTable as OperatorVTable<V>>::reduce(&self.0)
101101
}
102102

103103
fn reduce_parent(&self, parent: &ArrayRef, child_idx: usize) -> VortexResult<Option<ArrayRef>> {

vortex-array/src/compute/arrays/arithmetic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl VisitorVTable<ArithmeticVTable> for ArithmeticVTable {
181181
}
182182

183183
impl OperatorVTable<ArithmeticVTable> for ArithmeticVTable {
184-
fn reduce_children(array: &ArithmeticArray) -> VortexResult<Option<ArrayRef>> {
184+
fn reduce(array: &ArithmeticArray) -> VortexResult<Option<ArrayRef>> {
185185
match (array.lhs.as_constant(), array.rhs.as_constant()) {
186186
// If both sides are constant, we compute the value now.
187187
(Some(lhs), Some(rhs)) => {

vortex-array/src/vtable/operator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ pub trait OperatorVTable<V: VTable> {
7070
)
7171
}
7272

73-
/// Attempt to optimize this array by analyzing its children.
73+
/// Attempt to optimize this array tree looking at itself and its children.
7474
///
7575
/// For example, if all the children are constant, this function should perform constant
7676
/// folding and return a constant operator.
7777
///
7878
/// This function should typically be implemented only for self-contained optimizations based
79-
/// on child properties.
79+
/// Self and child properties.
8080
///
8181
/// Returns `None` if no optimization is possible.
82-
fn reduce_children(_array: &V::Array) -> VortexResult<Option<ArrayRef>> {
82+
fn reduce(_array: &V::Array) -> VortexResult<Option<ArrayRef>> {
8383
Ok(None)
8484
}
8585

0 commit comments

Comments
 (0)