#![warn(missing_docs)]
#![deny(unsafe_code)]
#![allow(clippy::module_name_repetitions)]
pub mod aggregate;
pub mod convert;
pub mod dedup;
pub mod downsample;
pub mod encoded_pushdown;
pub mod error;
pub mod filter;
pub mod memory;
pub mod plan;
pub mod pruning;
pub mod window;
pub use aggregate::AggFn;
pub use convert::points_to_record_batch;
pub use encoded_pushdown::{ColumnPredicate, EncodedDomainEvaluator, RowGroupVerdict};
pub use error::QueryError;
pub use memory::MemoryTracker;
pub use plan::{FieldPredicate, QueryBuilder, QueryPlan, ZoneMapOp};
pub use window::WindowFn;
pub fn extract_f64(col: &dyn arrow::array::Array, index: usize) -> Option<f64> {
use arrow::array::{Float64Array, Int64Array, UInt64Array};
if col.is_null(index) {
return None;
}
col.as_any()
.downcast_ref::<Float64Array>()
.map(|a| a.value(index))
.or_else(|| {
col.as_any()
.downcast_ref::<Int64Array>()
.map(|a| a.value(index) as f64)
})
.or_else(|| {
col.as_any()
.downcast_ref::<UInt64Array>()
.map(|a| a.value(index) as f64)
})
}