Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions encodings/alp/src/alp/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ use vortex_array::ArrayParts;
use vortex_array::ArrayRef;
use vortex_array::ArraySlots;
use vortex_array::ArrayView;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::TypedArrayRef;
use vortex_array::array_slots;
use vortex_array::arrays::Primitive;
Expand Down Expand Up @@ -55,14 +55,14 @@ use crate::alp::rules::RULES;
pub type ALPArray = Array<ALP>;

impl ArrayHash for ALPData {
fn array_hash<H: Hasher>(&self, state: &mut H, _precision: Precision) {
fn array_hash<H: Hasher>(&self, state: &mut H, _accuracy: EqMode) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should call these mode?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are like 10 million of them, I changed the trait so future impls will get filled in by IDEs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a simple find and replace

self.exponents.hash(state);
self.patches_data.hash(state);
}
}

impl ArrayEq for ALPData {
fn array_eq(&self, other: &Self, _precision: Precision) -> bool {
fn array_eq(&self, other: &Self, _accuracy: EqMode) -> bool {
self.exponents == other.exponents && self.patches_data == other.patches_data
}
}
Expand Down
10 changes: 5 additions & 5 deletions encodings/alp/src/alp_rd/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ use vortex_array::ArrayRef;
use vortex_array::ArraySlots;
use vortex_array::ArrayView;
use vortex_array::Canonical;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::LEGACY_SESSION;
use vortex_array::Precision;
use vortex_array::TypedArrayRef;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::Primitive;
Expand Down Expand Up @@ -75,17 +75,17 @@ pub struct ALPRDMetadata {
}

impl ArrayHash for ALPRDData {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: Precision) {
self.left_parts_dictionary.array_hash(state, precision);
fn array_hash<H: Hasher>(&self, state: &mut H, accuracy: EqMode) {
self.left_parts_dictionary.array_hash(state, accuracy);
self.right_bit_width.hash(state);
self.patches_data.hash(state);
}
}

impl ArrayEq for ALPRDData {
fn array_eq(&self, other: &Self, precision: Precision) -> bool {
fn array_eq(&self, other: &Self, accuracy: EqMode) -> bool {
self.left_parts_dictionary
.array_eq(&other.left_parts_dictionary, precision)
.array_eq(&other.left_parts_dictionary, accuracy)
&& self.right_bit_width == other.right_bit_width
&& self.patches_data == other.patches_data
}
Expand Down
10 changes: 5 additions & 5 deletions encodings/bytebool/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ use vortex_array::ArrayParts;
use vortex_array::ArrayRef;
use vortex_array::ArraySlots;
use vortex_array::ArrayView;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::TypedArrayRef;
use vortex_array::arrays::BoolArray;
use vortex_array::buffer::BufferHandle;
Expand Down Expand Up @@ -45,14 +45,14 @@ use crate::kernel::PARENT_KERNELS;
pub type ByteBoolArray = Array<ByteBool>;

impl ArrayHash for ByteBoolData {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: Precision) {
self.buffer.array_hash(state, precision);
fn array_hash<H: Hasher>(&self, state: &mut H, accuracy: EqMode) {
self.buffer.array_hash(state, accuracy);
}
}

impl ArrayEq for ByteBoolData {
fn array_eq(&self, other: &Self, precision: Precision) -> bool {
self.buffer.array_eq(&other.buffer, precision)
fn array_eq(&self, other: &Self, accuracy: EqMode) -> bool {
self.buffer.array_eq(&other.buffer, accuracy)
}
}

Expand Down
6 changes: 3 additions & 3 deletions encodings/datetime-parts/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ use vortex_array::ArrayId;
use vortex_array::ArrayParts;
use vortex_array::ArrayRef;
use vortex_array::ArrayView;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::array_slots;
use vortex_array::arrays::Primitive;
use vortex_array::arrays::TemporalArray;
Expand Down Expand Up @@ -50,11 +50,11 @@ use crate::split_temporal;
pub type DateTimePartsArray = Array<DateTimeParts>;

impl ArrayHash for DateTimePartsData {
fn array_hash<H: Hasher>(&self, _state: &mut H, _precision: Precision) {}
fn array_hash<H: Hasher>(&self, _state: &mut H, _accuracy: EqMode) {}
}

impl ArrayEq for DateTimePartsData {
fn array_eq(&self, _other: &Self, _precision: Precision) -> bool {
fn array_eq(&self, _other: &Self, _accuracy: EqMode) -> bool {
true
}
}
Expand Down
6 changes: 3 additions & 3 deletions encodings/decimal-byte-parts/src/decimal_byte_parts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use vortex_array::ArrayEq;
use vortex_array::ArrayHash;
use vortex_array::ArrayId;
use vortex_array::ArrayRef;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::TypedArrayRef;
use vortex_array::arrays::DecimalArray;
use vortex_array::arrays::PrimitiveArray;
Expand Down Expand Up @@ -53,11 +53,11 @@ use crate::decimal_byte_parts::rules::PARENT_RULES;
pub type DecimalBytePartsArray = Array<DecimalByteParts>;

impl ArrayHash for DecimalBytePartsData {
fn array_hash<H: Hasher>(&self, _state: &mut H, _precision: Precision) {}
fn array_hash<H: Hasher>(&self, _state: &mut H, _accuracy: EqMode) {}
}

impl ArrayEq for DecimalBytePartsData {
fn array_eq(&self, _other: &Self, _precision: Precision) -> bool {
fn array_eq(&self, _other: &Self, _accuracy: EqMode) -> bool {
true
}
}
Expand Down
10 changes: 5 additions & 5 deletions encodings/experimental/onpair/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ use vortex_array::ArrayParts;
use vortex_array::ArrayRef;
use vortex_array::ArrayView;
use vortex_array::Canonical;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::array_slots;
use vortex_array::buffer::BufferHandle;
use vortex_array::builders::ArrayBuilder;
Expand Down Expand Up @@ -196,19 +196,19 @@ impl Debug for OnPairData {
}

impl ArrayHash for OnPairData {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: Precision) {
self.dict_bytes.as_host().array_hash(state, precision);
fn array_hash<H: Hasher>(&self, state: &mut H, accuracy: EqMode) {
self.dict_bytes.as_host().array_hash(state, accuracy);
state.write_u32(self.bits);
}
}

impl ArrayEq for OnPairData {
fn array_eq(&self, other: &Self, precision: Precision) -> bool {
fn array_eq(&self, other: &Self, accuracy: EqMode) -> bool {
self.bits == other.bits
&& self
.dict_bytes
.as_host()
.array_eq(other.dict_bytes.as_host(), precision)
.array_eq(other.dict_bytes.as_host(), accuracy)
}
}

Expand Down
10 changes: 5 additions & 5 deletions encodings/fastlanes/src/bitpacking/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ use vortex_array::ArrayParts;
use vortex_array::ArrayRef;
use vortex_array::ArraySlots;
use vortex_array::ArrayView;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::buffer::BufferHandle;
use vortex_array::builders::ArrayBuilder;
use vortex_array::dtype::DType;
Expand Down Expand Up @@ -69,19 +69,19 @@ pub struct BitPackedMetadata {
}

impl ArrayHash for BitPackedData {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: Precision) {
fn array_hash<H: Hasher>(&self, state: &mut H, accuracy: EqMode) {
self.offset.hash(state);
self.bit_width.hash(state);
self.packed.array_hash(state, precision);
self.packed.array_hash(state, accuracy);
self.patches_data.hash(state);
}
}

impl ArrayEq for BitPackedData {
fn array_eq(&self, other: &Self, precision: Precision) -> bool {
fn array_eq(&self, other: &Self, accuracy: EqMode) -> bool {
self.offset == other.offset
&& self.bit_width == other.bit_width
&& self.packed.array_eq(&other.packed, precision)
&& self.packed.array_eq(&other.packed, accuracy)
&& self.patches_data == other.patches_data
}
}
Expand Down
6 changes: 3 additions & 3 deletions encodings/fastlanes/src/delta/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use vortex_array::ArrayId;
use vortex_array::ArrayParts;
use vortex_array::ArrayRef;
use vortex_array::ArrayView;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::buffer::BufferHandle;
use vortex_array::dtype::DType;
Expand Down Expand Up @@ -58,13 +58,13 @@ pub struct DeltaMetadata {
}

impl ArrayHash for DeltaData {
fn array_hash<H: Hasher>(&self, state: &mut H, _precision: Precision) {
fn array_hash<H: Hasher>(&self, state: &mut H, _accuracy: EqMode) {
self.offset.hash(state);
}
}

impl ArrayEq for DeltaData {
fn array_eq(&self, other: &Self, _precision: Precision) -> bool {
fn array_eq(&self, other: &Self, _accuracy: EqMode) -> bool {
self.offset == other.offset
}
}
Expand Down
6 changes: 3 additions & 3 deletions encodings/fastlanes/src/for/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use vortex_array::ArrayId;
use vortex_array::ArrayParts;
use vortex_array::ArrayRef;
use vortex_array::ArrayView;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::buffer::BufferHandle;
use vortex_array::dtype::DType;
Expand Down Expand Up @@ -50,13 +50,13 @@ mod validity;
pub type FoRArray = Array<FoR>;

impl ArrayHash for FoRData {
fn array_hash<H: Hasher>(&self, state: &mut H, _precision: Precision) {
fn array_hash<H: Hasher>(&self, state: &mut H, _accuracy: EqMode) {
self.reference.hash(state);
}
}

impl ArrayEq for FoRData {
fn array_eq(&self, other: &Self, _precision: Precision) -> bool {
fn array_eq(&self, other: &Self, _accuracy: EqMode) -> bool {
self.reference == other.reference
}
}
Expand Down
6 changes: 3 additions & 3 deletions encodings/fastlanes/src/rle/vtable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ use vortex_array::ArrayId;
use vortex_array::ArrayParts;
use vortex_array::ArrayRef;
use vortex_array::ArrayView;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::Precision;
use vortex_array::arrays::Primitive;
use vortex_array::buffer::BufferHandle;
use vortex_array::dtype::DType;
Expand Down Expand Up @@ -65,13 +65,13 @@ pub struct RLEMetadata {
}

impl ArrayHash for RLEData {
fn array_hash<H: Hasher>(&self, state: &mut H, _precision: Precision) {
fn array_hash<H: Hasher>(&self, state: &mut H, _accuracy: EqMode) {
self.offset.hash(state);
}
}

impl ArrayEq for RLEData {
fn array_eq(&self, other: &Self, _precision: Precision) -> bool {
fn array_eq(&self, other: &Self, _accuracy: EqMode) -> bool {
self.offset == other.offset
}
}
Expand Down
6 changes: 3 additions & 3 deletions encodings/fsst/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ use vortex_array::ArrayRef;
use vortex_array::ArraySlots;
use vortex_array::ArrayView;
use vortex_array::Canonical;
use vortex_array::EqMode;
use vortex_array::ExecutionCtx;
use vortex_array::ExecutionResult;
use vortex_array::IntoArray;
use vortex_array::LEGACY_SESSION;
use vortex_array::Precision;
use vortex_array::TypedArrayRef;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::VarBin;
Expand Down Expand Up @@ -80,7 +80,7 @@ impl FSSTMetadata {
}

impl ArrayHash for FSSTData {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: Precision) {
fn array_hash<H: Hasher>(&self, state: &mut H, precision: EqMode) {
self.symbol_table.symbols.array_hash(state, precision);
self.symbol_table
.symbol_lengths
Expand All @@ -90,7 +90,7 @@ impl ArrayHash for FSSTData {
}

impl ArrayEq for FSSTData {
fn array_eq(&self, other: &Self, precision: Precision) -> bool {
fn array_eq(&self, other: &Self, precision: EqMode) -> bool {
self.symbol_table
.symbols
.array_eq(&other.symbol_table.symbols, precision)
Expand Down
8 changes: 4 additions & 4 deletions encodings/parquet-variant/src/vtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ mod tests {
use vortex_array::ArrayEq;
use vortex_array::ArrayRef;
use vortex_array::Canonical;
use vortex_array::EqMode;
use vortex_array::IntoArray;
use vortex_array::LEGACY_SESSION;
use vortex_array::Precision;
use vortex_array::VTable;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
Expand Down Expand Up @@ -525,7 +525,7 @@ mod tests {
let array = outer_pv.into_array();
let decoded = roundtrip(array.clone())?;

assert!(array.array_eq(&decoded, Precision::Value));
assert!(array.array_eq(&decoded, EqMode::Value));
let decoded_pv = decoded
.as_opt::<ParquetVariant>()
.ok_or_else(|| vortex_err!("expected parquet variant array"))?;
Expand All @@ -547,7 +547,7 @@ mod tests {
let array = pv.into_array();
let decoded = roundtrip(array.clone())?;

assert!(array.array_eq(&decoded, Precision::Value));
assert!(array.array_eq(&decoded, EqMode::Value));
assert_eq!(decoded.dtype(), &DType::Variant(Nullability::Nullable));
let decoded_pv = decoded
.as_opt::<ParquetVariant>()
Expand All @@ -572,7 +572,7 @@ mod tests {
let array = outer_pv.into_array();
let decoded = roundtrip(array.clone())?;

assert!(array.array_eq(&decoded, Precision::Value));
assert!(array.array_eq(&decoded, EqMode::Value));
let decoded_pv = decoded
.as_opt::<ParquetVariant>()
.ok_or_else(|| vortex_err!("expected parquet variant array"))?;
Expand Down
Loading
Loading