-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: store min, max, null count, and true count in column metadata (#…
…1164) Co-authored-by: Will Manning <[email protected]>
- Loading branch information
1 parent
453fa61
commit f83a093
Showing
17 changed files
with
700 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
use vortex_buffer::{Buffer, BufferString}; | ||
use vortex_dtype::half::f16; | ||
use vortex_dtype::{DType, Nullability}; | ||
|
||
use super::{BoolArray, PrimitiveArray, VarBinViewArray}; | ||
use crate::validity::Validity; | ||
use crate::{Array, IntoArray as _}; | ||
|
||
// `From<Vec<Option<!>>> for Array` requries the experimental uninhabited type: !. | ||
|
||
impl From<Vec<Option<bool>>> for Array { | ||
fn from(value: Vec<Option<bool>>) -> Self { | ||
BoolArray::from_iter(value).into_array() | ||
} | ||
} | ||
|
||
macro_rules! impl_from_primitive_for_array { | ||
($P:ty) => { | ||
impl From<Vec<$P>> for Array { | ||
fn from(value: Vec<$P>) -> Self { | ||
PrimitiveArray::from_vec(value, Validity::NonNullable).into_array() | ||
} | ||
} | ||
|
||
impl From<Vec<Option<$P>>> for Array { | ||
fn from(value: Vec<Option<$P>>) -> Self { | ||
PrimitiveArray::from_nullable_vec(value).into_array() | ||
} | ||
} | ||
}; | ||
} | ||
|
||
impl_from_primitive_for_array!(u8); | ||
impl_from_primitive_for_array!(u16); | ||
impl_from_primitive_for_array!(u32); | ||
impl_from_primitive_for_array!(u64); | ||
impl_from_primitive_for_array!(i8); | ||
impl_from_primitive_for_array!(i16); | ||
impl_from_primitive_for_array!(i32); | ||
impl_from_primitive_for_array!(i64); | ||
impl_from_primitive_for_array!(f16); | ||
impl_from_primitive_for_array!(f32); | ||
impl_from_primitive_for_array!(f64); | ||
|
||
impl From<Vec<Option<BufferString>>> for Array { | ||
fn from(value: Vec<Option<BufferString>>) -> Self { | ||
VarBinViewArray::from_iter(value, DType::Utf8(Nullability::Nullable)).into_array() | ||
} | ||
} | ||
|
||
impl From<Vec<Option<Buffer>>> for Array { | ||
fn from(value: Vec<Option<Buffer>>) -> Self { | ||
VarBinViewArray::from_iter(value, DType::Binary(Nullability::Nullable)).into_array() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use vortex_error::VortexError; | ||
|
||
use crate::{Scalar, ScalarValue}; | ||
|
||
impl TryFrom<&Scalar> for () { | ||
type Error = VortexError; | ||
|
||
fn try_from(scalar: &Scalar) -> Result<Self, Self::Error> { | ||
scalar.value().as_null() | ||
} | ||
} | ||
|
||
impl TryFrom<Scalar> for () { | ||
type Error = VortexError; | ||
|
||
fn try_from(scalar: Scalar) -> Result<Self, Self::Error> { | ||
<()>::try_from(&scalar) | ||
} | ||
} | ||
|
||
impl TryFrom<&ScalarValue> for () { | ||
type Error = VortexError; | ||
|
||
fn try_from(value: &ScalarValue) -> Result<Self, Self::Error> { | ||
value.as_null() | ||
} | ||
} | ||
|
||
impl TryFrom<ScalarValue> for () { | ||
type Error = VortexError; | ||
|
||
fn try_from(value: ScalarValue) -> Result<Self, Self::Error> { | ||
<()>::try_from(&value) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.