Skip to content

Commit b358f0f

Browse files
committed
rename methods
Signed-off-by: Andrew Duffy <[email protected]>
1 parent 028e0ca commit b358f0f

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

vortex-layout/src/layouts/struct_/reader.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,18 @@ impl StructReader {
8080
}
8181

8282
/// Return the child reader for the field.
83-
fn child(&self, name: &FieldName) -> VortexResult<&LayoutReaderRef> {
83+
fn field_reader(&self, name: &FieldName) -> VortexResult<&LayoutReaderRef> {
8484
let idx = self
8585
.field_lookup
8686
.as_ref()
8787
.and_then(|lookup| lookup.get(name).copied())
8888
.or_else(|| self.struct_fields().find(name))
8989
.ok_or_else(|| vortex_err!("Field {} not found in struct layout", name))?;
90-
self.child_by_idx(idx)
90+
self.field_reader_by_index(idx)
9191
}
9292

9393
/// Return the child reader for the field, by index.
94-
fn child_by_idx(&self, idx: usize) -> VortexResult<&LayoutReaderRef> {
94+
fn field_reader_by_index(&self, idx: usize) -> VortexResult<&LayoutReaderRef> {
9595
let child_index = if self.dtype().is_nullable() {
9696
idx + 1
9797
} else {
@@ -209,7 +209,7 @@ impl LayoutReader for StructReader {
209209
splits.insert(row_offset + self.layout.row_count);
210210

211211
self.layout.matching_fields(field_mask, |mask, idx| {
212-
self.child_by_idx(idx)?
212+
self.field_reader_by_index(idx)?
213213
.register_splits(&[mask], row_offset, splits)
214214
})
215215
}
@@ -223,7 +223,7 @@ impl LayoutReader for StructReader {
223223
// Partition the expression into expressions that can be evaluated over individual fields
224224
match &self.partition_expr(expr.clone()) {
225225
Partitioned::Single(name, partition) => self
226-
.child(name)?
226+
.field_reader(name)?
227227
.pruning_evaluation(row_range, partition, mask),
228228
Partitioned::Multi(_) => {
229229
// TODO(ngates): if all partitions are boolean, we can use a pruning evaluation. Otherwise
@@ -242,13 +242,16 @@ impl LayoutReader for StructReader {
242242
// Partition the expression into expressions that can be evaluated over individual fields
243243
match &self.partition_expr(expr.clone()) {
244244
Partitioned::Single(name, partition) => self
245-
.child(name)?
245+
.field_reader(name)?
246246
.filter_evaluation(row_range, partition, mask),
247247
Partitioned::Multi(partitioned) => partitioned.clone().into_mask_future(
248248
mask,
249-
|name, expr, mask| self.child(name)?.filter_evaluation(row_range, expr, mask),
250249
|name, expr, mask| {
251-
self.child(name)?
250+
self.field_reader(name)?
251+
.filter_evaluation(row_range, expr, mask)
252+
},
253+
|name, expr, mask| {
254+
self.field_reader(name)?
252255
.projection_evaluation(row_range, expr, mask)
253256
},
254257
),
@@ -269,13 +272,13 @@ impl LayoutReader for StructReader {
269272
// Partition the expression into expressions that can be evaluated over individual fields
270273
let projection_fut = match &self.partition_expr(expr.clone()) {
271274
Partitioned::Single(name, partition) => self
272-
.child(name)?
275+
.field_reader(name)?
273276
.projection_evaluation(row_range, partition, mask),
274277
Partitioned::Multi(partitioned) => {
275278
partitioned
276279
.clone()
277280
.into_array_future(mask, |name, expr, mask| {
278-
self.child(name)?
281+
self.field_reader(name)?
279282
.projection_evaluation(row_range, expr, mask)
280283
})
281284
}

0 commit comments

Comments
 (0)