diff --git a/crates/rayexec_execution/src/arrays/array/mod.rs b/crates/rayexec_execution/src/arrays/array/mod.rs index 793fbdf41..07ee95750 100644 --- a/crates/rayexec_execution/src/arrays/array/mod.rs +++ b/crates/rayexec_execution/src/arrays/array/mod.rs @@ -1,4 +1,5 @@ pub mod buffer_manager; +pub mod physical_type; mod raw; mod shared_or_owned; @@ -7,18 +8,7 @@ use std::fmt::Debug; use std::sync::Arc; use half::f16; -use rayexec_error::{not_implemented, RayexecError, Result, ResultExt}; -use shared_or_owned::SharedOrOwned; - -use crate::arrays::bitmap::Bitmap; -use crate::arrays::datatype::DataType; -use crate::arrays::executor::builder::{ - ArrayBuilder, - BooleanBuffer, - GermanVarlenBuffer, - PrimitiveBuffer, -}; -use crate::arrays::executor::physical_type::{ +use physical_type::{ PhysicalAny, PhysicalBinary, PhysicalBool, @@ -39,6 +29,17 @@ use crate::arrays::executor::physical_type::{ PhysicalU8, PhysicalUtf8, }; +use rayexec_error::{not_implemented, RayexecError, Result, ResultExt}; +use shared_or_owned::SharedOrOwned; + +use crate::arrays::bitmap::Bitmap; +use crate::arrays::datatype::DataType; +use crate::arrays::executor::builder::{ + ArrayBuilder, + BooleanBuffer, + GermanVarlenBuffer, + PrimitiveBuffer, +}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::scalar::decimal::{Decimal128Scalar, Decimal64Scalar}; use crate::arrays::scalar::interval::Interval; diff --git a/crates/rayexec_execution/src/arrays/executor/physical_type.rs b/crates/rayexec_execution/src/arrays/array/physical_type.rs similarity index 85% rename from crates/rayexec_execution/src/arrays/executor/physical_type.rs rename to crates/rayexec_execution/src/arrays/array/physical_type.rs index 516b9831f..e8f7aa766 100644 --- a/crates/rayexec_execution/src/arrays/executor/physical_type.rs +++ b/crates/rayexec_execution/src/arrays/array/physical_type.rs @@ -1,11 +1,16 @@ -use std::fmt::Debug; +use std::fmt::{self, Debug}; use half::f16; use rayexec_error::{RayexecError, Result, ResultExt}; use rayexec_proto::ProtoConv; -use super::builder::{ArrayDataBuffer, BooleanBuffer, GermanVarlenBuffer, PrimitiveBuffer}; use crate::arrays::array::{Array, ArrayData, BinaryData}; +use crate::arrays::executor::builder::{ + ArrayDataBuffer, + BooleanBuffer, + GermanVarlenBuffer, + PrimitiveBuffer, +}; use crate::arrays::scalar::interval::Interval; use crate::arrays::storage::{ AddressableStorage, @@ -40,6 +45,8 @@ pub enum PhysicalType { Binary, Utf8, List, + Struct, + Dictionary, } impl PhysicalType { @@ -68,10 +75,43 @@ impl PhysicalType { array: Array::new_untyped_null_array(0), } .into(), + _ => unimplemented!(), + } + } + + pub const fn as_str(&self) -> &'static str { + match self { + Self::UntypedNull => "UntypedNull", + Self::Boolean => "Boolean", + Self::Int8 => "Int8", + Self::Int16 => "Int16", + Self::Int32 => "Int32", + Self::Int64 => "Int64", + Self::Int128 => "Int128", + Self::UInt8 => "UInt8", + Self::UInt16 => "UInt16", + Self::UInt32 => "UInt32", + Self::UInt64 => "UInt64", + Self::UInt128 => "UInt128", + Self::Float16 => "Float16", + Self::Float32 => "Float32", + Self::Float64 => "Float64", + Self::Interval => "Interval", + Self::Binary => "Binary", + Self::Utf8 => "Utf8", + Self::List => "List", + Self::Struct => "Struct", + Self::Dictionary => "Dictionary", } } } +impl fmt::Display for PhysicalType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.as_str()) + } +} + impl ProtoConv for PhysicalType { type ProtoType = rayexec_proto::generated::physical_type::PhysicalType; @@ -96,6 +136,8 @@ impl ProtoConv for PhysicalType { Self::Utf8 => Self::ProtoType::Utf8, Self::Binary => Self::ProtoType::Binary, Self::List => Self::ProtoType::List, + Self::Struct => Self::ProtoType::Struct, + Self::Dictionary => Self::ProtoType::Dictionary, }) } @@ -121,10 +163,81 @@ impl ProtoConv for PhysicalType { Self::ProtoType::Utf8 => Self::Utf8, Self::ProtoType::Binary => Self::Binary, Self::ProtoType::List => Self::List, + Self::ProtoType::Struct => Self::Struct, + Self::ProtoType::Dictionary => Self::Dictionary, }) } } +/// Represents an in-memory array that can be indexed into to retrieve values. +pub trait Addressable: Debug { + /// The type that get's returned. + type T: Send + Debug + ?Sized; + + fn len(&self) -> usize; + + fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Get a value at the given index. + fn get(&self, idx: usize) -> Option<&Self::T>; +} + +impl Addressable for &[T] +where + T: Debug + Send, +{ + type T = T; + + fn len(&self) -> usize { + (**self).len() + } + + fn get(&self, idx: usize) -> Option<&Self::T> { + (**self).get(idx) + } +} + +/// Represents in-memory storage that we can get mutable references to. +pub trait AddressableMut: Debug { + type T: Debug + ?Sized; + + fn len(&self) -> usize; + + fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Get a mutable reference to a value at the given index. + fn get_mut(&mut self, idx: usize) -> Option<&mut Self::T>; + + /// Put a value at the given index. + /// + /// Should panic if index is out of bounds. + fn put(&mut self, idx: usize, val: &Self::T); +} + +impl AddressableMut for &mut [T] +where + T: Debug + Send + Copy, +{ + type T = T; + + fn len(&self) -> usize { + (**self).len() + } + + fn get_mut(&mut self, idx: usize) -> Option<&mut Self::T> { + (**self).get_mut(idx) + } + + fn put(&mut self, idx: usize, val: &Self::T) { + self[idx] = *val; + } +} + +// TODO: Remove /// Types able to convert themselves to byte slices. pub trait AsBytes { fn as_bytes(&self) -> &[u8]; @@ -154,6 +267,7 @@ impl AsBytes for &[u8] { } } +// TODO: Remove /// Types that can be converted from bytes. /// /// This should not be implemented for `&str`/`&[u8]`. @@ -174,19 +288,20 @@ impl VarlenType for [u8] { } /// Helper trait for getting the underlying data for an array. -/// -/// Contains a lifetime to enable tying the returned storage to the provided -/// array data. pub trait PhysicalStorage: Debug + Sync + Send + Clone + Copy + 'static { + // TODO: Remove /// The type that gets returned from the underlying array storage. type Type<'a>: Sync + Send; + // TODO: Remove /// The type of the underlying array storage. type Storage<'a>: AddressableStorage>; + // TODO: Remove /// Gets the storage for the array that we can access directly. fn get_storage(data: &ArrayData) -> Result>; } +// TODO: Remove /// Type that's able to be used for any physical type. /// /// While this allows any array type to used in the executors, there's no way to diff --git a/crates/rayexec_execution/src/arrays/compute/cast/array.rs b/crates/rayexec_execution/src/arrays/compute/cast/array.rs index 76845aa06..58d13455f 100644 --- a/crates/rayexec_execution/src/arrays/compute/cast/array.rs +++ b/crates/rayexec_execution/src/arrays/compute/cast/array.rs @@ -48,16 +48,7 @@ use super::parse::{ UInt64Parser, UInt8Parser, }; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::bitmap::Bitmap; -use crate::arrays::datatype::{DataType, TimeUnit}; -use crate::arrays::executor::builder::{ - ArrayBuilder, - BooleanBuffer, - GermanVarlenBuffer, - PrimitiveBuffer, -}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBool, PhysicalF16, PhysicalF32, @@ -75,6 +66,15 @@ use crate::arrays::executor::physical_type::{ PhysicalU8, PhysicalUtf8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::bitmap::Bitmap; +use crate::arrays::datatype::{DataType, TimeUnit}; +use crate::arrays::executor::builder::{ + ArrayBuilder, + BooleanBuffer, + GermanVarlenBuffer, + PrimitiveBuffer, +}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::scalar::decimal::{Decimal128Type, Decimal64Type, DecimalType}; use crate::arrays::storage::{AddressableStorage, PrimitiveStorage}; diff --git a/crates/rayexec_execution/src/arrays/compute/date.rs b/crates/rayexec_execution/src/arrays/compute/date.rs index 7e02e1498..c9d6032bf 100644 --- a/crates/rayexec_execution/src/arrays/compute/date.rs +++ b/crates/rayexec_execution/src/arrays/compute/date.rs @@ -1,10 +1,10 @@ use chrono::{DateTime, Datelike, NaiveDate, Timelike, Utc}; use rayexec_error::{not_implemented, RayexecError, Result}; +use crate::arrays::array::physical_type::{PhysicalI32, PhysicalI64}; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DecimalTypeMeta, TimeUnit}; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{PhysicalI32, PhysicalI64}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::scalar::decimal::{Decimal64Type, DecimalType}; diff --git a/crates/rayexec_execution/src/arrays/datatype.rs b/crates/rayexec_execution/src/arrays/datatype.rs index b6ba28fc3..1f55f5cf0 100644 --- a/crates/rayexec_execution/src/arrays/datatype.rs +++ b/crates/rayexec_execution/src/arrays/datatype.rs @@ -4,7 +4,7 @@ use rayexec_error::{not_implemented, OptionExt, RayexecError, Result, ResultExt} use rayexec_proto::ProtoConv; use serde::{Deserialize, Serialize}; -use crate::arrays::executor::physical_type::PhysicalType; +use crate::arrays::array::physical_type::PhysicalType; use crate::arrays::field::Field; use crate::arrays::scalar::decimal::{Decimal128Type, Decimal64Type, DecimalType}; diff --git a/crates/rayexec_execution/src/arrays/executor/aggregate/binary.rs b/crates/rayexec_execution/src/arrays/executor/aggregate/binary.rs index 26e2f30bd..a0cbf0478 100644 --- a/crates/rayexec_execution/src/arrays/executor/aggregate/binary.rs +++ b/crates/rayexec_execution/src/arrays/executor/aggregate/binary.rs @@ -1,8 +1,8 @@ use rayexec_error::{RayexecError, Result}; use super::{AggregateState, RowToStateMapping}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::Array; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::check_validity; use crate::arrays::selection; use crate::arrays::storage::AddressableStorage; @@ -77,7 +77,7 @@ impl BinaryNonNullUpdater { #[cfg(test)] mod tests { use super::*; - use crate::arrays::executor::physical_type::PhysicalI32; + use crate::arrays::array::physical_type::PhysicalI32; // SUM(col) + PRODUCT(col) #[derive(Debug)] diff --git a/crates/rayexec_execution/src/arrays/executor/aggregate/unary.rs b/crates/rayexec_execution/src/arrays/executor/aggregate/unary.rs index 512f4e1e2..197b1dc92 100644 --- a/crates/rayexec_execution/src/arrays/executor/aggregate/unary.rs +++ b/crates/rayexec_execution/src/arrays/executor/aggregate/unary.rs @@ -1,8 +1,8 @@ use rayexec_error::Result; use super::{AggregateState, RowToStateMapping}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::Array; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::selection; use crate::arrays::storage::AddressableStorage; @@ -60,7 +60,7 @@ impl UnaryNonNullUpdater { #[cfg(test)] mod tests { use super::*; - use crate::arrays::executor::physical_type::{PhysicalI32, PhysicalUtf8}; + use crate::arrays::array::physical_type::{PhysicalI32, PhysicalUtf8}; #[derive(Debug, Default)] struct TestSumState { diff --git a/crates/rayexec_execution/src/arrays/executor/builder.rs b/crates/rayexec_execution/src/arrays/executor/builder.rs index a634dc552..c2577a614 100644 --- a/crates/rayexec_execution/src/arrays/executor/builder.rs +++ b/crates/rayexec_execution/src/arrays/executor/builder.rs @@ -1,7 +1,7 @@ use std::marker::PhantomData; use std::sync::Arc; -use super::physical_type::{AsBytes, VarlenType}; +use crate::arrays::array::physical_type::{AsBytes, VarlenType}; use crate::arrays::array::{ArrayData, BinaryData}; use crate::arrays::bitmap::Bitmap; use crate::arrays::datatype::DataType; diff --git a/crates/rayexec_execution/src/arrays/executor/mod.rs b/crates/rayexec_execution/src/arrays/executor/mod.rs index 28f0bbf91..454b52c84 100644 --- a/crates/rayexec_execution/src/arrays/executor/mod.rs +++ b/crates/rayexec_execution/src/arrays/executor/mod.rs @@ -1,4 +1,3 @@ pub mod aggregate; pub mod builder; -pub mod physical_type; pub mod scalar; diff --git a/crates/rayexec_execution/src/arrays/executor/scalar/binary.rs b/crates/rayexec_execution/src/arrays/executor/scalar/binary.rs index f289147c9..b2b898804 100644 --- a/crates/rayexec_execution/src/arrays/executor/scalar/binary.rs +++ b/crates/rayexec_execution/src/arrays/executor/scalar/binary.rs @@ -1,10 +1,10 @@ use rayexec_error::Result; use super::check_validity; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::Array; use crate::arrays::bitmap::Bitmap; use crate::arrays::executor::builder::{ArrayBuilder, ArrayDataBuffer, OutputBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::validate_logical_len; use crate::arrays::selection; use crate::arrays::storage::AddressableStorage; @@ -95,9 +95,9 @@ mod tests { use selection::SelectionVector; use super::*; + use crate::arrays::array::physical_type::{PhysicalI32, PhysicalUtf8}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{GermanVarlenBuffer, PrimitiveBuffer}; - use crate::arrays::executor::physical_type::{PhysicalI32, PhysicalUtf8}; use crate::arrays::scalar::ScalarValue; #[test] diff --git a/crates/rayexec_execution/src/arrays/executor/scalar/fill.rs b/crates/rayexec_execution/src/arrays/executor/scalar/fill.rs index 8029004ba..9af0856ef 100644 --- a/crates/rayexec_execution/src/arrays/executor/scalar/fill.rs +++ b/crates/rayexec_execution/src/arrays/executor/scalar/fill.rs @@ -1,18 +1,8 @@ use std::borrow::Borrow; -use rayexec_error::{RayexecError, Result}; +use rayexec_error::{not_implemented, RayexecError, Result}; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::bitmap::Bitmap; -use crate::arrays::datatype::DataType; -use crate::arrays::executor::builder::{ - ArrayBuilder, - ArrayDataBuffer, - BooleanBuffer, - GermanVarlenBuffer, - PrimitiveBuffer, -}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBinary, PhysicalBool, PhysicalF16, @@ -34,6 +24,16 @@ use crate::arrays::executor::physical_type::{ PhysicalU8, PhysicalUtf8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::bitmap::Bitmap; +use crate::arrays::datatype::DataType; +use crate::arrays::executor::builder::{ + ArrayBuilder, + ArrayDataBuffer, + BooleanBuffer, + GermanVarlenBuffer, + PrimitiveBuffer, +}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::selection; use crate::arrays::storage::{ @@ -279,6 +279,7 @@ pub(crate) fn concat_with_exact_total_len(arrays: &[&Array], total_len: usize) - concat_with_fill_state::(arrays, state) } PhysicalType::List => concat_lists(datatype.clone(), arrays, total_len), + other => not_implemented!("concat: {other}"), } } @@ -502,12 +503,7 @@ pub fn interleave(arrays: &[&Array], indices: &[(usize, usize)]) -> Result(arrays, indices, state) } - PhysicalType::List => { - // TODO: Also doable - Err(RayexecError::new( - "interleaving list arrays not yet supported", - )) - } + other => not_implemented!("interleave: {other}"), } } @@ -548,9 +544,9 @@ where #[cfg(test)] mod tests { use super::*; + use crate::arrays::array::physical_type::PhysicalI32; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::PrimitiveBuffer; - use crate::arrays::executor::physical_type::PhysicalI32; use crate::arrays::scalar::ScalarValue; #[test] diff --git a/crates/rayexec_execution/src/arrays/executor/scalar/hash.rs b/crates/rayexec_execution/src/arrays/executor/scalar/hash.rs index 548bcb850..ada4787bb 100644 --- a/crates/rayexec_execution/src/arrays/executor/scalar/hash.rs +++ b/crates/rayexec_execution/src/arrays/executor/scalar/hash.rs @@ -1,9 +1,8 @@ use ahash::RandomState; use half::f16; -use rayexec_error::{RayexecError, Result}; +use rayexec_error::{not_implemented, RayexecError, Result}; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBinary, PhysicalBool, PhysicalF16, @@ -25,6 +24,7 @@ use crate::arrays::executor::physical_type::{ PhysicalUntypedNull, PhysicalUtf8, }; +use crate::arrays::array::{Array, ArrayData}; use crate::arrays::scalar::interval::Interval; use crate::arrays::selection; use crate::arrays::storage::{AddressableStorage, UntypedNull}; @@ -95,6 +95,7 @@ impl HashExecutor { Self::hash_one_inner::(array, hashes)? } PhysicalType::List => Self::hash_list::(array, hashes)?, + other => not_implemented!("Hash for type: {other}"), } Ok(()) @@ -159,6 +160,7 @@ impl HashExecutor { Self::hash_one_inner::(array, hashes)? } PhysicalType::List => Self::hash_list::(array, hashes)?, + other => not_implemented!("Hash for type: {other}"), } Ok(()) diff --git a/crates/rayexec_execution/src/arrays/executor/scalar/list.rs b/crates/rayexec_execution/src/arrays/executor/scalar/list.rs index f1b0ff63d..48eee5cb2 100644 --- a/crates/rayexec_execution/src/arrays/executor/scalar/list.rs +++ b/crates/rayexec_execution/src/arrays/executor/scalar/list.rs @@ -1,9 +1,9 @@ use rayexec_error::{not_implemented, RayexecError, Result}; +use crate::arrays::array::physical_type::{PhysicalList, PhysicalStorage}; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::bitmap::Bitmap; use crate::arrays::executor::builder::{ArrayBuilder, ArrayDataBuffer}; -use crate::arrays::executor::physical_type::{PhysicalList, PhysicalStorage}; use crate::arrays::executor::scalar::{ can_skip_validity_check, check_validity, diff --git a/crates/rayexec_execution/src/arrays/executor/scalar/select.rs b/crates/rayexec_execution/src/arrays/executor/scalar/select.rs index 7e7e37e2d..bdf53746f 100644 --- a/crates/rayexec_execution/src/arrays/executor/scalar/select.rs +++ b/crates/rayexec_execution/src/arrays/executor/scalar/select.rs @@ -1,7 +1,7 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::{PhysicalBool, PhysicalStorage}; use crate::arrays::array::Array; -use crate::arrays::executor::physical_type::{PhysicalBool, PhysicalStorage}; use crate::arrays::selection::{self, SelectionVector}; use crate::arrays::storage::AddressableStorage; diff --git a/crates/rayexec_execution/src/arrays/executor/scalar/ternary.rs b/crates/rayexec_execution/src/arrays/executor/scalar/ternary.rs index cdde8aee2..12cced342 100644 --- a/crates/rayexec_execution/src/arrays/executor/scalar/ternary.rs +++ b/crates/rayexec_execution/src/arrays/executor/scalar/ternary.rs @@ -3,10 +3,10 @@ use std::fmt::Debug; use rayexec_error::Result; use super::check_validity; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::Array; use crate::arrays::bitmap::Bitmap; use crate::arrays::executor::builder::{ArrayBuilder, ArrayDataBuffer, OutputBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::validate_logical_len; use crate::arrays::selection; use crate::arrays::storage::AddressableStorage; diff --git a/crates/rayexec_execution/src/arrays/executor/scalar/unary.rs b/crates/rayexec_execution/src/arrays/executor/scalar/unary.rs index 778ff7838..5fe14229d 100644 --- a/crates/rayexec_execution/src/arrays/executor/scalar/unary.rs +++ b/crates/rayexec_execution/src/arrays/executor/scalar/unary.rs @@ -1,10 +1,10 @@ use rayexec_error::Result; use super::validate_logical_len; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::Array; use crate::arrays::bitmap::Bitmap; use crate::arrays::executor::builder::{ArrayBuilder, ArrayDataBuffer, OutputBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::selection; use crate::arrays::storage::AddressableStorage; @@ -152,9 +152,9 @@ mod tests { use selection::SelectionVector; use super::*; + use crate::arrays::array::physical_type::{PhysicalI32, PhysicalUtf8}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{GermanVarlenBuffer, PrimitiveBuffer}; - use crate::arrays::executor::physical_type::{PhysicalI32, PhysicalUtf8}; use crate::arrays::scalar::ScalarValue; #[test] diff --git a/crates/rayexec_execution/src/arrays/executor/scalar/uniform.rs b/crates/rayexec_execution/src/arrays/executor/scalar/uniform.rs index 7a7b01083..8121fdae2 100644 --- a/crates/rayexec_execution/src/arrays/executor/scalar/uniform.rs +++ b/crates/rayexec_execution/src/arrays/executor/scalar/uniform.rs @@ -1,10 +1,10 @@ use rayexec_error::{RayexecError, Result}; use super::check_validity; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::Array; use crate::arrays::bitmap::Bitmap; use crate::arrays::executor::builder::{ArrayBuilder, ArrayDataBuffer, OutputBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::validate_logical_len; use crate::arrays::selection; use crate::arrays::storage::AddressableStorage; @@ -109,9 +109,9 @@ mod tests { use selection::SelectionVector; use super::*; + use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::GermanVarlenBuffer; - use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::scalar::ScalarValue; #[test] diff --git a/crates/rayexec_execution/src/arrays/row/encoding.rs b/crates/rayexec_execution/src/arrays/row/encoding.rs index 67d059e0f..572d8a34e 100644 --- a/crates/rayexec_execution/src/arrays/row/encoding.rs +++ b/crates/rayexec_execution/src/arrays/row/encoding.rs @@ -1,8 +1,7 @@ use half::f16; use rayexec_error::{not_implemented, RayexecError, Result}; -use crate::arrays::array::{Array, ArrayData, BinaryData}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ AsBytes, PhysicalBinary, PhysicalBool, @@ -22,6 +21,7 @@ use crate::arrays::executor::physical_type::{ PhysicalU64, PhysicalU8, }; +use crate::arrays::array::{Array, ArrayData, BinaryData}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::scalar::interval::Interval; diff --git a/crates/rayexec_execution/src/arrays/scalar/decimal.rs b/crates/rayexec_execution/src/arrays/scalar/decimal.rs index 041a7aca5..0dc200d71 100644 --- a/crates/rayexec_execution/src/arrays/scalar/decimal.rs +++ b/crates/rayexec_execution/src/arrays/scalar/decimal.rs @@ -5,7 +5,7 @@ use rayexec_error::{RayexecError, Result, ResultExt}; use rayexec_proto::ProtoConv; use serde::{Deserialize, Serialize}; -use crate::arrays::executor::physical_type::{PhysicalI128, PhysicalI64, PhysicalStorage}; +use crate::arrays::array::physical_type::{PhysicalI128, PhysicalI64, PhysicalStorage}; pub trait DecimalPrimitive: PrimInt + FromPrimitive + Signed + Default + Debug + Display + Sync + Send diff --git a/crates/rayexec_execution/src/arrays/storage/german.rs b/crates/rayexec_execution/src/arrays/storage/german.rs index 1a8c15c43..629e1a8cb 100644 --- a/crates/rayexec_execution/src/arrays/storage/german.rs +++ b/crates/rayexec_execution/src/arrays/storage/german.rs @@ -3,7 +3,7 @@ use std::fmt; use rayexec_error::Result; use super::{AddressableStorage, PrimitiveStorage}; -use crate::arrays::executor::physical_type::AsBytes; +use crate::arrays::array::physical_type::AsBytes; /// Byte length threshold for inlining varlen data in the array's metadata. pub(crate) const INLINE_THRESHOLD: i32 = 12; diff --git a/crates/rayexec_execution/src/execution/operators/hash_aggregate/chunk.rs b/crates/rayexec_execution/src/execution/operators/hash_aggregate/chunk.rs index 46caf2618..6a5baf1b5 100644 --- a/crates/rayexec_execution/src/execution/operators/hash_aggregate/chunk.rs +++ b/crates/rayexec_execution/src/execution/operators/hash_aggregate/chunk.rs @@ -2,8 +2,8 @@ use rayexec_error::Result; use super::hash_table::GroupAddress; use super::AggregateStates; +use crate::arrays::array::physical_type::PhysicalType; use crate::arrays::array::Array; -use crate::arrays::executor::physical_type::PhysicalType; use crate::arrays::executor::scalar::concat; use crate::execution::operators::util::resizer::DEFAULT_TARGET_BATCH_SIZE; use crate::functions::aggregate::ChunkGroupAddressIter; diff --git a/crates/rayexec_execution/src/execution/operators/hash_aggregate/compare.rs b/crates/rayexec_execution/src/execution/operators/hash_aggregate/compare.rs index 74c781e5d..b93ec55ba 100644 --- a/crates/rayexec_execution/src/execution/operators/hash_aggregate/compare.rs +++ b/crates/rayexec_execution/src/execution/operators/hash_aggregate/compare.rs @@ -4,8 +4,7 @@ use rayexec_error::{not_implemented, Result}; use super::chunk::GroupChunk; use super::hash_table::GroupAddress; -use crate::arrays::array::Array; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBinary, PhysicalBool, PhysicalF16, @@ -27,6 +26,7 @@ use crate::arrays::executor::physical_type::{ PhysicalUntypedNull, PhysicalUtf8, }; +use crate::arrays::array::Array; use crate::arrays::executor::scalar::{can_skip_validity_check, check_validity}; use crate::arrays::selection::{self, SelectionVector}; use crate::arrays::storage::AddressableStorage; @@ -158,9 +158,7 @@ where PhysicalType::Utf8 => { compare_rows_eq::(array1, array2, rows1, rows2, not_eq_rows)? } - PhysicalType::List => { - not_implemented!("Row compare list") - } + other => not_implemented!("Row compare: {other}"), } } diff --git a/crates/rayexec_execution/src/execution/operators/hash_aggregate/mod.rs b/crates/rayexec_execution/src/execution/operators/hash_aggregate/mod.rs index b6c7ea605..220eafcd9 100644 --- a/crates/rayexec_execution/src/execution/operators/hash_aggregate/mod.rs +++ b/crates/rayexec_execution/src/execution/operators/hash_aggregate/mod.rs @@ -16,12 +16,12 @@ use parking_lot::Mutex; use rayexec_error::{RayexecError, Result}; use super::{ExecutionStates, InputOutputStates, PollFinalize}; +use crate::arrays::array::physical_type::PhysicalU64; use crate::arrays::array::Array; use crate::arrays::batch::Batch; use crate::arrays::bitmap::Bitmap; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalU64; use crate::arrays::executor::scalar::{HashExecutor, UnaryExecutor}; use crate::arrays::scalar::ScalarValue; use crate::arrays::selection::SelectionVector; diff --git a/crates/rayexec_execution/src/execution/operators/unnest.rs b/crates/rayexec_execution/src/execution/operators/unnest.rs index 9667554df..709498f01 100644 --- a/crates/rayexec_execution/src/execution/operators/unnest.rs +++ b/crates/rayexec_execution/src/execution/operators/unnest.rs @@ -15,17 +15,7 @@ use super::{ PollPull, PollPush, }; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::batch::Batch; -use crate::arrays::bitmap::Bitmap; -use crate::arrays::executor::builder::{ - ArrayBuilder, - ArrayDataBuffer, - BooleanBuffer, - GermanVarlenBuffer, - PrimitiveBuffer, -}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBinary, PhysicalBool, PhysicalF16, @@ -46,6 +36,16 @@ use crate::arrays::executor::physical_type::{ PhysicalU8, PhysicalUtf8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::batch::Batch; +use crate::arrays::bitmap::Bitmap; +use crate::arrays::executor::builder::{ + ArrayBuilder, + ArrayDataBuffer, + BooleanBuffer, + GermanVarlenBuffer, + PrimitiveBuffer, +}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::selection::{self, SelectionVector}; use crate::arrays::storage::{AddressableStorage, ListItemMetadata}; diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/avg.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/avg.rs index 205107c09..b5a3ba42c 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/avg.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/avg.rs @@ -6,12 +6,12 @@ use num_traits::AsPrimitive; use rayexec_error::Result; use serde::{Deserialize, Serialize}; +use crate::arrays::array::physical_type::{PhysicalF64, PhysicalI64}; use crate::arrays::array::Array; use crate::arrays::bitmap::Bitmap; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; use crate::arrays::executor::builder::{ArrayBuilder, ArrayDataBuffer, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{PhysicalF64, PhysicalI64}; use crate::arrays::scalar::decimal::{Decimal128Type, Decimal64Type, DecimalType}; use crate::expr::Expression; use crate::functions::aggregate::states::{ diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/corr.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/corr.rs index ad557baf5..f90fe4542 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/corr.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/corr.rs @@ -4,9 +4,9 @@ use rayexec_error::Result; use super::covar::{CovarPopFinalize, CovarState}; use super::stddev::{StddevPopFinalize, VarianceState}; +use crate::arrays::array::physical_type::PhysicalF64; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::PhysicalF64; use crate::expr::Expression; use crate::functions::aggregate::states::{ new_binary_aggregate_states, diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/count.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/count.rs index 68761f921..19c5875ad 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/count.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/count.rs @@ -1,8 +1,8 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalAny; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::PhysicalAny; use crate::expr::{self, Expression}; use crate::functions::aggregate::states::{ new_unary_aggregate_states, diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/covar.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/covar.rs index 7de84c41f..50561da20 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/covar.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/covar.rs @@ -3,9 +3,9 @@ use std::marker::PhantomData; use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalF64; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::PhysicalF64; use crate::expr::Expression; use crate::functions::aggregate::states::{ new_binary_aggregate_states, diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/first.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/first.rs index d15fcc709..3f31ba76c 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/first.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/first.rs @@ -4,11 +4,7 @@ use std::marker::PhantomData; use half::f16; use rayexec_error::{not_implemented, Result}; -use crate::arrays::array::ArrayData; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::aggregate::{AggregateState, StateFinalizer}; -use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBinary, PhysicalBool, PhysicalF16, @@ -29,6 +25,10 @@ use crate::arrays::executor::physical_type::{ PhysicalU8, PhysicalUntypedNull, }; +use crate::arrays::array::ArrayData; +use crate::arrays::datatype::{DataType, DataTypeId}; +use crate::arrays::executor::aggregate::{AggregateState, StateFinalizer}; +use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; use crate::arrays::scalar::interval::Interval; use crate::arrays::storage::{PrimitiveStorage, UntypedNull}; use crate::expr::Expression; @@ -132,10 +132,7 @@ impl AggregateFunction for First { PhysicalType::Utf8 => Box::new(FirstBinaryImpl { datatype: datatype.clone(), }), - PhysicalType::List => { - // TODO: Easy, clone underlying array and select. - not_implemented!("FIRST for list arrays") - } + other => not_implemented!("FIRST: {other}"), }; Ok(PlannedAggregateFunction { diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/minmax.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/minmax.rs index 50793c642..312d850d6 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/minmax.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/minmax.rs @@ -4,11 +4,7 @@ use std::marker::PhantomData; use half::f16; use rayexec_error::{not_implemented, Result}; -use crate::arrays::array::ArrayData; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::aggregate::{AggregateState, StateFinalizer}; -use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBinary, PhysicalBool, PhysicalF16, @@ -29,6 +25,10 @@ use crate::arrays::executor::physical_type::{ PhysicalU8, PhysicalUntypedNull, }; +use crate::arrays::array::ArrayData; +use crate::arrays::datatype::{DataType, DataTypeId}; +use crate::arrays::executor::aggregate::{AggregateState, StateFinalizer}; +use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; use crate::arrays::scalar::interval::Interval; use crate::arrays::storage::{PrimitiveStorage, UntypedNull}; use crate::expr::Expression; @@ -128,8 +128,8 @@ impl AggregateFunction for Min { ), PhysicalType::Binary => Box::new(MinBinaryImpl::new(datatype.clone())), PhysicalType::Utf8 => Box::new(MinBinaryImpl::new(datatype.clone())), - PhysicalType::List => { - not_implemented!("MIN for list arrays") + other => { + not_implemented!("MIN for type: {other}") } }; @@ -222,8 +222,8 @@ impl AggregateFunction for Max { ), PhysicalType::Binary => Box::new(MaxBinaryImpl::new(datatype.clone())), PhysicalType::Utf8 => Box::new(MaxBinaryImpl::new(datatype.clone())), - PhysicalType::List => { - not_implemented!("MAX for list arrays") + other => { + not_implemented!("MAX for type: {other}") } }; diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/regr_avg.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/regr_avg.rs index 040fd880b..67cd8b763 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/regr_avg.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/regr_avg.rs @@ -3,9 +3,9 @@ use std::marker::PhantomData; use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalF64; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::PhysicalF64; use crate::expr::Expression; use crate::functions::aggregate::states::{ new_binary_aggregate_states, diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/regr_count.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/regr_count.rs index 2a26b0169..5fc7f5f6e 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/regr_count.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/regr_count.rs @@ -2,9 +2,9 @@ use std::fmt::Debug; use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalAny; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::PhysicalAny; use crate::expr::Expression; use crate::functions::aggregate::states::{ new_binary_aggregate_states, diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/regr_r2.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/regr_r2.rs index 11941ba7c..ea836ad9e 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/regr_r2.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/regr_r2.rs @@ -3,9 +3,9 @@ use std::fmt::Debug; use rayexec_error::Result; use super::corr::CorrelationState; +use crate::arrays::array::physical_type::PhysicalF64; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::PhysicalF64; use crate::expr::Expression; use crate::functions::aggregate::states::{ new_binary_aggregate_states, diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/regr_slope.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/regr_slope.rs index 4d4dd5ba7..f1576da57 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/regr_slope.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/regr_slope.rs @@ -4,9 +4,9 @@ use rayexec_error::Result; use super::covar::{CovarPopFinalize, CovarState}; use super::stddev::{VariancePopFinalize, VarianceState}; +use crate::arrays::array::physical_type::PhysicalF64; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::PhysicalF64; use crate::expr::Expression; use crate::functions::aggregate::states::{ new_binary_aggregate_states, diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/stddev.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/stddev.rs index 0e66f7d67..956d6e0c5 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/stddev.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/stddev.rs @@ -3,9 +3,9 @@ use std::marker::PhantomData; use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalF64; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::PhysicalF64; use crate::expr::Expression; use crate::functions::aggregate::states::{ new_unary_aggregate_states, diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/string_agg.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/string_agg.rs index 5484f9938..d0ddc1973 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/string_agg.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/string_agg.rs @@ -2,10 +2,10 @@ use std::fmt::Debug; use rayexec_error::{RayexecError, Result}; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::{AggregateState, StateFinalizer}; use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::scalar::ScalarValue; use crate::expr::Expression; use crate::functions::aggregate::states::{new_unary_aggregate_states, AggregateGroupStates}; diff --git a/crates/rayexec_execution/src/functions/aggregate/builtin/sum.rs b/crates/rayexec_execution/src/functions/aggregate/builtin/sum.rs index 379d60935..1c82068f8 100644 --- a/crates/rayexec_execution/src/functions/aggregate/builtin/sum.rs +++ b/crates/rayexec_execution/src/functions/aggregate/builtin/sum.rs @@ -5,10 +5,10 @@ use std::ops::AddAssign; use num_traits::CheckedAdd; use rayexec_error::Result; +use crate::arrays::array::physical_type::{PhysicalF64, PhysicalI64}; use crate::arrays::array::ArrayData; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::aggregate::AggregateState; -use crate::arrays::executor::physical_type::{PhysicalF64, PhysicalI64}; use crate::arrays::scalar::decimal::{Decimal128Type, Decimal64Type, DecimalType}; use crate::arrays::storage::PrimitiveStorage; use crate::expr::Expression; diff --git a/crates/rayexec_execution/src/functions/aggregate/states.rs b/crates/rayexec_execution/src/functions/aggregate/states.rs index a6d2a0f5e..8264dc19b 100644 --- a/crates/rayexec_execution/src/functions/aggregate/states.rs +++ b/crates/rayexec_execution/src/functions/aggregate/states.rs @@ -6,6 +6,7 @@ use rayexec_error::{RayexecError, Result}; use stdutil::marker::PhantomCovariant; use super::ChunkGroupAddressIter; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::aggregate::{ @@ -16,7 +17,6 @@ use crate::arrays::executor::aggregate::{ UnaryNonNullUpdater, }; use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::storage::{AddressableStorage, PrimitiveStorage}; pub struct TypedAggregateGroupStates { diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/arith/add.rs b/crates/rayexec_execution/src/functions/scalar/builtin/arith/add.rs index a3bd2318e..019caa673 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/arith/add.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/arith/add.rs @@ -3,10 +3,7 @@ use std::marker::PhantomData; use rayexec_error::Result; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalF16, PhysicalF32, PhysicalF64, @@ -22,6 +19,9 @@ use crate::arrays::executor::physical_type::{ PhysicalU64, PhysicalU8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::datatype::{DataType, DataTypeId}; +use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; use crate::arrays::executor::scalar::BinaryExecutor; use crate::arrays::storage::PrimitiveStorage; use crate::expr::Expression; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/arith/div.rs b/crates/rayexec_execution/src/functions/scalar/builtin/arith/div.rs index f5c27bd17..15e94eebd 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/arith/div.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/arith/div.rs @@ -3,12 +3,7 @@ use std::marker::PhantomData; use rayexec_error::Result; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::compute::cast::array::cast_decimal_to_float; -use crate::arrays::compute::cast::behavior::CastFailBehavior; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalF16, PhysicalF32, PhysicalF64, @@ -24,6 +19,11 @@ use crate::arrays::executor::physical_type::{ PhysicalU64, PhysicalU8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::compute::cast::array::cast_decimal_to_float; +use crate::arrays::compute::cast::behavior::CastFailBehavior; +use crate::arrays::datatype::{DataType, DataTypeId}; +use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; use crate::arrays::executor::scalar::BinaryExecutor; use crate::arrays::scalar::decimal::{Decimal128Type, Decimal64Type, DecimalType}; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/arith/mul.rs b/crates/rayexec_execution/src/functions/scalar/builtin/arith/mul.rs index 1a2c3d9e9..cfe6b1973 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/arith/mul.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/arith/mul.rs @@ -4,10 +4,7 @@ use std::marker::PhantomData; use num_traits::{NumCast, PrimInt}; use rayexec_error::Result; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::datatype::{DataType, DataTypeId, DecimalTypeMeta}; -use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalF16, PhysicalF32, PhysicalF64, @@ -24,6 +21,9 @@ use crate::arrays::executor::physical_type::{ PhysicalU64, PhysicalU8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::datatype::{DataType, DataTypeId, DecimalTypeMeta}; +use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; use crate::arrays::executor::scalar::BinaryExecutor; use crate::arrays::scalar::decimal::{Decimal128Type, Decimal64Type, DecimalType}; use crate::arrays::scalar::interval::Interval; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/arith/rem.rs b/crates/rayexec_execution/src/functions/scalar/builtin/arith/rem.rs index 52beb91ff..daf560916 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/arith/rem.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/arith/rem.rs @@ -3,10 +3,7 @@ use std::marker::PhantomData; use rayexec_error::Result; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalF16, PhysicalF32, PhysicalF64, @@ -22,6 +19,9 @@ use crate::arrays::executor::physical_type::{ PhysicalU64, PhysicalU8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::datatype::{DataType, DataTypeId}; +use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; use crate::arrays::executor::scalar::BinaryExecutor; use crate::arrays::storage::PrimitiveStorage; use crate::expr::Expression; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/arith/sub.rs b/crates/rayexec_execution/src/functions/scalar/builtin/arith/sub.rs index 5936265ad..f034234c9 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/arith/sub.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/arith/sub.rs @@ -3,10 +3,7 @@ use std::marker::PhantomData; use rayexec_error::Result; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalF16, PhysicalF32, PhysicalF64, @@ -22,6 +19,9 @@ use crate::arrays::executor::physical_type::{ PhysicalU64, PhysicalU8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::datatype::{DataType, DataTypeId}; +use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; use crate::arrays::executor::scalar::BinaryExecutor; use crate::arrays::storage::PrimitiveStorage; use crate::expr::Expression; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/boolean.rs b/crates/rayexec_execution/src/functions/scalar/builtin/boolean.rs index c72438ec5..7048e0a5f 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/boolean.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/boolean.rs @@ -3,11 +3,11 @@ use std::fmt::Debug; use rayexec_error::Result; use serde::{Deserialize, Serialize}; +use crate::arrays::array::physical_type::PhysicalBool; use crate::arrays::array::Array; use crate::arrays::bitmap::Bitmap; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; -use crate::arrays::executor::physical_type::PhysicalBool; use crate::arrays::executor::scalar::{BinaryExecutor, TernaryExecutor, UniformExecutor}; use crate::arrays::storage::BooleanStorage; use crate::expr::Expression; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/comparison.rs b/crates/rayexec_execution/src/functions/scalar/builtin/comparison.rs index 23ba23a54..216d9fd8d 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/comparison.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/comparison.rs @@ -2,14 +2,9 @@ use std::cmp::Ordering; use std::fmt::Debug; use std::marker::PhantomData; -use rayexec_error::{RayexecError, Result}; +use rayexec_error::{not_implemented, Result}; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::compute::cast::array::decimal_rescale; -use crate::arrays::compute::cast::behavior::CastFailBehavior; -use crate::arrays::datatype::{DataType, DataTypeId, DecimalTypeMeta}; -use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBinary, PhysicalBool, PhysicalF16, @@ -31,6 +26,11 @@ use crate::arrays::executor::physical_type::{ PhysicalUntypedNull, PhysicalUtf8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::compute::cast::array::decimal_rescale; +use crate::arrays::compute::cast::behavior::CastFailBehavior; +use crate::arrays::datatype::{DataType, DataTypeId, DecimalTypeMeta}; +use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; use crate::arrays::executor::scalar::{BinaryExecutor, BinaryListReducer, FlexibleListExecutor}; use crate::arrays::scalar::decimal::{Decimal128Type, Decimal64Type, DecimalType}; use crate::arrays::storage::PrimitiveStorage; @@ -760,11 +760,7 @@ where left, right, builder, )? } - PhysicalType::List => { - return Err(RayexecError::new( - "Comparison between nested lists not yet supported", - )) - } + other => not_implemented!("comparison: {other}"), }; Ok(array) diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/datetime/date_trunc.rs b/crates/rayexec_execution/src/functions/scalar/builtin/datetime/date_trunc.rs index b677bd584..366dab4df 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/datetime/date_trunc.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/datetime/date_trunc.rs @@ -2,10 +2,10 @@ use std::str::FromStr; use rayexec_error::{not_implemented, RayexecError, Result}; +use crate::arrays::array::physical_type::PhysicalI64; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId, TimeUnit, TimestampTypeMeta}; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalI64; use crate::arrays::executor::scalar::UnaryExecutor; use crate::expr::Expression; use crate::functions::scalar::{PlannedScalarFunction, ScalarFunction, ScalarFunctionImpl}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/datetime/epoch.rs b/crates/rayexec_execution/src/functions/scalar/builtin/datetime/epoch.rs index 536dee3ac..5fa5a9060 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/datetime/epoch.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/datetime/epoch.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalI64; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId, TimeUnit, TimestampTypeMeta}; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalI64; use crate::arrays::executor::scalar::UnaryExecutor; use crate::expr::Expression; use crate::functions::scalar::{PlannedScalarFunction, ScalarFunction, ScalarFunctionImpl}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/is.rs b/crates/rayexec_execution/src/functions/scalar/builtin/is.rs index 69a221936..ec18e7dc1 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/is.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/is.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::{PhysicalAny, PhysicalBool}; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; -use crate::arrays::executor::physical_type::{PhysicalAny, PhysicalBool}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/list/list_extract.rs b/crates/rayexec_execution/src/functions/scalar/builtin/list/list_extract.rs index 9c9287700..4e14e95f8 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/list/list_extract.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/list/list_extract.rs @@ -4,17 +4,7 @@ use half::f16; use rayexec_error::{not_implemented, RayexecError, Result}; use serde::{Deserialize, Serialize}; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::bitmap::Bitmap; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::builder::{ - ArrayBuilder, - ArrayDataBuffer, - BooleanBuffer, - GermanVarlenBuffer, - PrimitiveBuffer, -}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBinary, PhysicalBool, PhysicalF16, @@ -35,6 +25,16 @@ use crate::arrays::executor::physical_type::{ PhysicalU8, PhysicalUtf8, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::bitmap::Bitmap; +use crate::arrays::datatype::{DataType, DataTypeId}; +use crate::arrays::executor::builder::{ + ArrayBuilder, + ArrayDataBuffer, + BooleanBuffer, + GermanVarlenBuffer, + PrimitiveBuffer, +}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/negate.rs b/crates/rayexec_execution/src/functions/scalar/builtin/negate.rs index fc3099d39..e4dee990e 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/negate.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/negate.rs @@ -2,10 +2,7 @@ use std::marker::PhantomData; use rayexec_error::Result; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalBool, PhysicalF16, PhysicalF32, @@ -17,6 +14,9 @@ use crate::arrays::executor::physical_type::{ PhysicalI8, PhysicalStorage, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::datatype::{DataType, DataTypeId}; +use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer, PrimitiveBuffer}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; use crate::expr::Expression; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/abs.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/abs.rs index c47048fef..713176f72 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/abs.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/abs.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/acos.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/acos.rs index ab989ab52..9c9480413 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/acos.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/acos.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/asin.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/asin.rs index d2721fa9d..adba975ff 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/asin.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/asin.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/atan.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/atan.rs index 8a3aad508..44dad7144 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/atan.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/atan.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/cbrt.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/cbrt.rs index fe97f1980..231adb19b 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/cbrt.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/cbrt.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/ceil.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/ceil.rs index 49b0a14d4..f417610af 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/ceil.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/ceil.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/cos.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/cos.rs index 35d3e82b7..d628eb514 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/cos.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/cos.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/degrees.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/degrees.rs index 634d2497c..e294d50f2 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/degrees.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/degrees.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/exp.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/exp.rs index a71e4a70f..b79b76605 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/exp.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/exp.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/floor.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/floor.rs index 4e8ef22d3..408e5b71c 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/floor.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/floor.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/isnan.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/isnan.rs index 37d56a348..2d8dc4af9 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/isnan.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/isnan.rs @@ -4,15 +4,10 @@ use num_traits::Float; use rayexec_error::Result; use super::ScalarFunction; +use crate::arrays::array::physical_type::{PhysicalF16, PhysicalF32, PhysicalF64, PhysicalStorage}; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; -use crate::arrays::executor::physical_type::{ - PhysicalF16, - PhysicalF32, - PhysicalF64, - PhysicalStorage, -}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/ln.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/ln.rs index 6bd68c098..f92ab55c7 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/ln.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/ln.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/log.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/log.rs index c668a51e3..01d671713 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/log.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/log.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/mod.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/mod.rs index a2dcb12df..6af0e15ce 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/mod.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/mod.rs @@ -38,15 +38,15 @@ pub use sin::*; pub use sqrt::*; pub use tan::*; -use crate::arrays::array::{Array, ArrayData}; -use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::physical_type::{ +use crate::arrays::array::physical_type::{ PhysicalF16, PhysicalF32, PhysicalF64, PhysicalStorage, PhysicalType, }; +use crate::arrays::array::{Array, ArrayData}; +use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::storage::PrimitiveStorage; use crate::expr::Expression; use crate::functions::scalar::{PlannedScalarFunction, ScalarFunction, ScalarFunctionImpl}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/radians.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/radians.rs index d4c71dbfa..a6522de7b 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/radians.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/radians.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/sin.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/sin.rs index 7561269c9..cfb9bae30 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/sin.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/sin.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/sqrt.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/sqrt.rs index 8770db9df..91a09e568 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/sqrt.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/sqrt.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/tan.rs b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/tan.rs index 67d0377af..15168274a 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/numeric/tan.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/numeric/tan.rs @@ -2,10 +2,10 @@ use num_traits::Float; use rayexec_error::Result; use super::{UnaryInputNumericOperation, UnaryInputNumericScalar}; +use crate::arrays::array::physical_type::PhysicalStorage; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::DataType; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalStorage; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::storage::PrimitiveStorage; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/similarity/l2_distance.rs b/crates/rayexec_execution/src/functions/scalar/builtin/similarity/l2_distance.rs index 8db1686f8..b86e16ae5 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/similarity/l2_distance.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/similarity/l2_distance.rs @@ -4,15 +4,10 @@ use std::ops::AddAssign; use num_traits::{AsPrimitive, Float}; use rayexec_error::Result; +use crate::arrays::array::physical_type::{PhysicalF16, PhysicalF32, PhysicalF64, PhysicalStorage}; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{ - PhysicalF16, - PhysicalF32, - PhysicalF64, - PhysicalStorage, -}; use crate::arrays::executor::scalar::{BinaryListReducer, ListExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/ascii.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/ascii.rs index fc7beda38..462b4f64f 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/ascii.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/ascii.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::UnaryExecutor; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/case.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/case.rs index 2c8ed0a36..87e9ea589 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/case.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/case.rs @@ -1,9 +1,9 @@ use rayexec_error::{RayexecError, Result}; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::UnaryExecutor; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/concat.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/concat.rs index 1b7c5ae40..82b849ed5 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/concat.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/concat.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::{BinaryExecutor, UniformExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/contains.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/contains.rs index 8cda9192a..7f8b232e5 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/contains.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/contains.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::{BinaryExecutor, UnaryExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/ends_with.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/ends_with.rs index 86d166b50..8e2cb4818 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/ends_with.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/ends_with.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::{BinaryExecutor, UnaryExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/length.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/length.rs index 7943e24eb..f5241a4a3 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/length.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/length.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::{PhysicalBinary, PhysicalUtf8}; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, PrimitiveBuffer}; -use crate::arrays::executor::physical_type::{PhysicalBinary, PhysicalUtf8}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/like.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/like.rs index 539b35255..d1c45bb08 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/like.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/like.rs @@ -1,10 +1,10 @@ use rayexec_error::{Result, ResultExt}; use regex::{escape, Regex}; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::{BinaryExecutor, UnaryExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/pad.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/pad.rs index ff554eea4..1937b77e5 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/pad.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/pad.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::{PhysicalI64, PhysicalUtf8}; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::{PhysicalI64, PhysicalUtf8}; use crate::arrays::executor::scalar::{BinaryExecutor, TernaryExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/regexp_replace.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/regexp_replace.rs index 34b2ca556..7963156c5 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/regexp_replace.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/regexp_replace.rs @@ -1,10 +1,10 @@ use rayexec_error::{Result, ResultExt}; use regex::Regex; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::{BinaryExecutor, TernaryExecutor, UnaryExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/repeat.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/repeat.rs index b725787bc..aee4db029 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/repeat.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/repeat.rs @@ -2,10 +2,10 @@ use std::fmt::Debug; use rayexec_error::Result; +use crate::arrays::array::physical_type::{PhysicalI64, PhysicalUtf8}; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::{PhysicalI64, PhysicalUtf8}; use crate::arrays::executor::scalar::BinaryExecutor; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/starts_with.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/starts_with.rs index 9c7113461..afbe7393c 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/starts_with.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/starts_with.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, BooleanBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::{BinaryExecutor, UnaryExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/substring.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/substring.rs index d338a27cc..306dc5322 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/substring.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/substring.rs @@ -1,9 +1,9 @@ use rayexec_error::Result; +use crate::arrays::array::physical_type::{PhysicalI64, PhysicalUtf8}; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::{PhysicalI64, PhysicalUtf8}; use crate::arrays::executor::scalar::{BinaryExecutor, TernaryExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/scalar/builtin/string/trim.rs b/crates/rayexec_execution/src/functions/scalar/builtin/string/trim.rs index d36f04e87..2b753c3dd 100644 --- a/crates/rayexec_execution/src/functions/scalar/builtin/string/trim.rs +++ b/crates/rayexec_execution/src/functions/scalar/builtin/string/trim.rs @@ -3,10 +3,10 @@ use std::marker::PhantomData; use rayexec_error::Result; +use crate::arrays::array::physical_type::PhysicalUtf8; use crate::arrays::array::Array; use crate::arrays::datatype::{DataType, DataTypeId}; use crate::arrays::executor::builder::{ArrayBuilder, GermanVarlenBuffer}; -use crate::arrays::executor::physical_type::PhysicalUtf8; use crate::arrays::executor::scalar::{BinaryExecutor, UnaryExecutor}; use crate::expr::Expression; use crate::functions::documentation::{Category, Documentation, Example}; diff --git a/crates/rayexec_execution/src/functions/table/builtin/series.rs b/crates/rayexec_execution/src/functions/table/builtin/series.rs index aef14ab0a..c9179be35 100644 --- a/crates/rayexec_execution/src/functions/table/builtin/series.rs +++ b/crates/rayexec_execution/src/functions/table/builtin/series.rs @@ -3,10 +3,10 @@ use std::task::{Context, Waker}; use rayexec_error::{RayexecError, Result}; +use crate::arrays::array::physical_type::PhysicalI64; use crate::arrays::array::Array; use crate::arrays::batch::Batch; use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::physical_type::PhysicalI64; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::field::{Field, Schema}; use crate::arrays::scalar::OwnedScalarValue; diff --git a/crates/rayexec_execution/src/functions/table/builtin/unnest.rs b/crates/rayexec_execution/src/functions/table/builtin/unnest.rs index 0535b3f5c..ee42d1a16 100644 --- a/crates/rayexec_execution/src/functions/table/builtin/unnest.rs +++ b/crates/rayexec_execution/src/functions/table/builtin/unnest.rs @@ -3,10 +3,10 @@ use std::task::{Context, Waker}; use rayexec_error::{RayexecError, Result}; +use crate::arrays::array::physical_type::{PhysicalList, PhysicalType}; use crate::arrays::array::{Array, ArrayData}; use crate::arrays::batch::Batch; use crate::arrays::datatype::{DataType, DataTypeId}; -use crate::arrays::executor::physical_type::{PhysicalList, PhysicalType}; use crate::arrays::executor::scalar::UnaryExecutor; use crate::arrays::field::{Field, Schema}; use crate::arrays::scalar::OwnedScalarValue; diff --git a/crates/rayexec_parquet/src/writer/mod.rs b/crates/rayexec_parquet/src/writer/mod.rs index 1e380b9df..6b7e77a4f 100644 --- a/crates/rayexec_parquet/src/writer/mod.rs +++ b/crates/rayexec_parquet/src/writer/mod.rs @@ -12,10 +12,10 @@ use parquet::file::writer::{write_page, SerializedFileWriter}; use parquet::format::FileMetaData; use parquet::schema::types::SchemaDescriptor; use rayexec_error::{not_implemented, OptionExt, RayexecError, Result, ResultExt}; +use rayexec_execution::arrays::array::physical_type::{PhysicalBinary, PhysicalStorage}; use rayexec_execution::arrays::array::{Array, ArrayData}; use rayexec_execution::arrays::batch::Batch; use rayexec_execution::arrays::datatype::DataType; -use rayexec_execution::arrays::executor::physical_type::{PhysicalBinary, PhysicalStorage}; use rayexec_execution::arrays::field::Schema; use rayexec_execution::arrays::storage::AddressableStorage; use rayexec_io::FileSink; diff --git a/crates/rayexec_proto/proto/physical_type.proto b/crates/rayexec_proto/proto/physical_type.proto index ad6f21bc6..768dacf40 100644 --- a/crates/rayexec_proto/proto/physical_type.proto +++ b/crates/rayexec_proto/proto/physical_type.proto @@ -23,4 +23,6 @@ enum PhysicalType { BINARY = 17; UTF8 = 18; LIST = 19; + STRUCT = 20; + DICTIONARY = 21; }