Skip to content

Commit 9ffb47a

Browse files
committed
Rename List take slice dispatch helpers
Signed-off-by: Daniel King <dan@spiraldb.com>
1 parent 09ca199 commit 9ffb47a

1 file changed

Lines changed: 16 additions & 30 deletions

File tree

  • vortex-array/src/arrays/list/compute

vortex-array/src/arrays/list/compute/take.rs

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl TakeExecute for List {
5050
ctx: &mut ExecutionCtx,
5151
) -> VortexResult<Option<ArrayRef>> {
5252
if let Some(piecewise_indices) = indices.as_opt::<PiecewiseSequence>()
53-
&& let Some(taken) = take_piecewise_sequence(array, piecewise_indices, indices, ctx)?
53+
&& let Some(taken) = take_slices(array, piecewise_indices, indices, ctx)?
5454
{
5555
return Ok(Some(taken));
5656
}
@@ -145,7 +145,7 @@ fn _take<I: IntegerPType, O: IntegerPType, OutputOffsetType: IntegerPType>(
145145
.into_array())
146146
}
147147

148-
fn take_piecewise_sequence(
148+
fn take_slices(
149149
array: ArrayView<'_, List>,
150150
indices: ArrayView<'_, PiecewiseSequence>,
151151
indices_ref: &ArrayRef,
@@ -168,7 +168,7 @@ fn take_piecewise_sequence(
168168
let taken = match lengths {
169169
Columnar::Constant(lengths) => {
170170
let length = constant_unsigned_usize(&lengths);
171-
take_piecewise_sequence_constant_dispatch(
171+
take_slices_constant_start_dispatch(
172172
array,
173173
&starts,
174174
length,
@@ -179,20 +179,13 @@ fn take_piecewise_sequence(
179179
}
180180
Columnar::Canonical(lengths) => {
181181
let lengths = lengths.into_primitive();
182-
take_piecewise_sequence_lengths_dispatch(
183-
array,
184-
&starts,
185-
&lengths,
186-
&offsets,
187-
indices_ref,
188-
output_len,
189-
)?
182+
take_slices_start_dispatch(array, &starts, &lengths, &offsets, indices_ref, output_len)?
190183
}
191184
};
192185
Ok(Some(taken))
193186
}
194187

195-
fn take_piecewise_sequence_constant_dispatch(
188+
fn take_slices_constant_start_dispatch(
196189
array: ArrayView<'_, List>,
197190
starts: &PrimitiveArray,
198191
length: usize,
@@ -201,7 +194,7 @@ fn take_piecewise_sequence_constant_dispatch(
201194
output_len: usize,
202195
) -> VortexResult<ArrayRef> {
203196
match_each_unsigned_integer_ptype!(starts.ptype(), |S| {
204-
take_piecewise_sequence_constant_start_dispatch::<S>(
197+
take_slices_constant_offset_dispatch::<S>(
205198
array,
206199
starts,
207200
length,
@@ -212,7 +205,7 @@ fn take_piecewise_sequence_constant_dispatch(
212205
})
213206
}
214207

215-
fn take_piecewise_sequence_constant_start_dispatch<S>(
208+
fn take_slices_constant_offset_dispatch<S>(
216209
array: ArrayView<'_, List>,
217210
starts: &PrimitiveArray,
218211
length: usize,
@@ -224,7 +217,7 @@ where
224217
S: UnsignedPType,
225218
{
226219
match_each_unsigned_integer_ptype!(offsets.ptype(), |O| {
227-
take_piecewise_sequence_constant_length::<S, O>(
220+
take_slices_constant_length::<S, O>(
228221
array,
229222
starts.as_slice::<S>(),
230223
length,
@@ -235,7 +228,7 @@ where
235228
})
236229
}
237230

238-
fn take_piecewise_sequence_lengths_dispatch(
231+
fn take_slices_start_dispatch(
239232
array: ArrayView<'_, List>,
240233
starts: &PrimitiveArray,
241234
lengths: &PrimitiveArray,
@@ -244,18 +237,11 @@ fn take_piecewise_sequence_lengths_dispatch(
244237
output_len: usize,
245238
) -> VortexResult<ArrayRef> {
246239
match_each_unsigned_integer_ptype!(starts.ptype(), |S| {
247-
take_piecewise_sequence_lengths_start_dispatch::<S>(
248-
array,
249-
starts,
250-
lengths,
251-
offsets,
252-
indices_ref,
253-
output_len,
254-
)
240+
take_slices_length_dispatch::<S>(array, starts, lengths, offsets, indices_ref, output_len)
255241
})
256242
}
257243

258-
fn take_piecewise_sequence_lengths_start_dispatch<S>(
244+
fn take_slices_length_dispatch<S>(
259245
array: ArrayView<'_, List>,
260246
starts: &PrimitiveArray,
261247
lengths: &PrimitiveArray,
@@ -267,7 +253,7 @@ where
267253
S: UnsignedPType,
268254
{
269255
match_each_unsigned_integer_ptype!(lengths.ptype(), |L| {
270-
take_piecewise_sequence_lengths_start_length_dispatch::<S, L>(
256+
take_slices_offset_dispatch::<S, L>(
271257
array,
272258
starts,
273259
lengths,
@@ -278,7 +264,7 @@ where
278264
})
279265
}
280266

281-
fn take_piecewise_sequence_lengths_start_length_dispatch<S, L>(
267+
fn take_slices_offset_dispatch<S, L>(
282268
array: ArrayView<'_, List>,
283269
starts: &PrimitiveArray,
284270
lengths: &PrimitiveArray,
@@ -291,7 +277,7 @@ where
291277
L: UnsignedPType,
292278
{
293279
match_each_unsigned_integer_ptype!(offsets.ptype(), |O| {
294-
take_piecewise_sequence_typed::<S, L, O>(
280+
take_slices_typed::<S, L, O>(
295281
array,
296282
starts.as_slice::<S>(),
297283
lengths.as_slice::<L>(),
@@ -302,7 +288,7 @@ where
302288
})
303289
}
304290

305-
fn take_piecewise_sequence_constant_length<S, Offset>(
291+
fn take_slices_constant_length<S, Offset>(
306292
array: ArrayView<'_, List>,
307293
starts: &[S],
308294
length: usize,
@@ -345,7 +331,7 @@ where
345331
})
346332
}
347333

348-
fn take_piecewise_sequence_typed<S, L, Offset>(
334+
fn take_slices_typed<S, L, Offset>(
349335
array: ArrayView<'_, List>,
350336
starts: &[S],
351337
lengths: &[L],

0 commit comments

Comments
 (0)