|
4 | 4 | use std::hash::{Hash, Hasher}; |
5 | 5 | use std::sync::LazyLock; |
6 | 6 |
|
7 | | -use enum_map::{enum_map, Enum, EnumMap}; |
| 7 | +use enum_map::{Enum, EnumMap, enum_map}; |
8 | 8 | use vortex_buffer::ByteBuffer; |
9 | 9 | use vortex_compute::arithmetic::{Add, Checked, CheckedOperator, Div, Mul, Sub}; |
10 | | -use vortex_dtype::{match_each_native_ptype, DType, NativePType, PTypeDowncastExt}; |
11 | | -use vortex_error::{vortex_err, VortexExpect, VortexResult}; |
| 10 | +use vortex_dtype::{DType, NativePType, PTypeDowncastExt, match_each_native_ptype}; |
| 11 | +use vortex_error::{VortexExpect, VortexResult, vortex_err}; |
12 | 12 | use vortex_scalar::{PValue, Scalar}; |
13 | 13 |
|
14 | 14 | use crate::arrays::ConstantArray; |
15 | | -use crate::execution::{kernel, BatchKernelRef, BindCtx}; |
| 15 | +use crate::execution::{BatchKernelRef, BindCtx, kernel}; |
16 | 16 | use crate::serde::ArrayChildren; |
17 | 17 | use crate::stats::{ArrayStats, StatsSetRef}; |
18 | 18 | use crate::vtable::{ |
19 | 19 | ArrayVTable, NotSupported, OperatorVTable, SerdeVTable, VTable, VisitorVTable, |
20 | 20 | }; |
21 | 21 | use crate::{ |
22 | | - vtable, Array, ArrayBufferVisitor, ArrayChildVisitor, ArrayEq, ArrayHash, |
23 | | - ArrayRef, DeserializeMetadata, EmptyMetadata, EncodingId, EncodingRef, IntoArray, Precision, |
| 22 | + Array, ArrayBufferVisitor, ArrayChildVisitor, ArrayEq, ArrayHash, ArrayRef, |
| 23 | + DeserializeMetadata, EmptyMetadata, EncodingId, EncodingRef, IntoArray, Precision, vtable, |
24 | 24 | }; |
25 | 25 |
|
26 | 26 | /// The set of operators supported by an arithmetic array. |
@@ -223,11 +223,9 @@ impl OperatorVTable<ArithmeticVTable> for ArithmeticVTable { |
223 | 223 | if let Some(rhs) = array.rhs.as_constant() { |
224 | 224 | if rhs.is_null() { |
225 | 225 | // If the RHS is null, the result is always null. |
226 | | - return Ok( |
227 | | - ConstantArray::new(Scalar::null(array.dtype().clone()), array.len()) |
228 | | - .into_array() |
229 | | - .bind(selection, ctx)?, |
230 | | - ); |
| 226 | + return ConstantArray::new(Scalar::null(array.dtype().clone()), array.len()) |
| 227 | + .into_array() |
| 228 | + .bind(selection, ctx); |
231 | 229 | } |
232 | 230 |
|
233 | 231 | let lhs = ctx.bind(&array.lhs, selection)?; |
@@ -289,7 +287,7 @@ where |
289 | 287 |
|
290 | 288 | #[cfg(test)] |
291 | 289 | mod tests { |
292 | | - use vortex_buffer::buffer; |
| 290 | + use vortex_buffer::{bitbuffer, buffer}; |
293 | 291 | use vortex_dtype::PTypeDowncastExt; |
294 | 292 |
|
295 | 293 | use crate::arrays::PrimitiveArray; |
@@ -365,7 +363,7 @@ mod tests { |
365 | 363 | let lhs = PrimitiveArray::from_iter([1u32, 2, 3]).into_array(); |
366 | 364 | let rhs = PrimitiveArray::from_iter([10u32, 20, 30]).into_array(); |
367 | 365 |
|
368 | | - let selection = PrimitiveArray::from_iter([0u64, 2]).into_array(); |
| 366 | + let selection = bitbuffer![1 0 1].into_array(); |
369 | 367 |
|
370 | 368 | let result = add(lhs, rhs) |
371 | 369 | .execute_with_selection(Some(&selection)) |
|
0 commit comments