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
14 changes: 8 additions & 6 deletions encodings/runend/src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ impl ArrayParentReduceRule<Exact<RunEndVTable>, AnyScalarFn> for RunEndScalarFnR
.into_array();

Ok(Some(
RunEndArray::try_new_offset_length(
run_end.ends().clone(),
new_values,
run_end.offset(),
run_end.len(),
)?
unsafe {
RunEndArray::new_unchecked(
run_end.ends().clone(),
new_values,
run_end.offset(),
run_end.len(),
)
}
.into_array(),
))
}
Expand Down
6 changes: 5 additions & 1 deletion vortex-array/src/optimizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ impl ArrayOptimizer {
// No real reason to pick 4.
let max_iterations = array.depth_first_traversal().count() * 4;

inner(self, array, max_iterations)
tracing::debug!("Starting array optimization\n{}", array.display_tree());
let array = inner(self, array, max_iterations)?;
tracing::debug!("Optimized array\n{}", array.display_tree());

Ok(array)
}

/// Register a reduce rule for a specific array encoding.
Expand Down
13 changes: 1 addition & 12 deletions vortex-layout/src/layouts/flat/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use vortex_array::expr::Expression;
use vortex_array::expr::Root;
use vortex_array::mask::MaskExecutor;
use vortex_array::serde::ArrayParts;
use vortex_array::session::ArraySessionExt;
use vortex_dtype::DType;
use vortex_dtype::FieldMask;
use vortex_error::VortexExpect;
Expand Down Expand Up @@ -134,7 +133,6 @@ impl LayoutReader for FlatReader {
let array = self.array_future();
let expr = expr.clone();
let session = self.session.clone();
let optimizer = self.session.arrays().optimizer().clone();

Ok(MaskFuture::new(mask.len(), async move {
// TODO(ngates): if the mask density is low enough, or if the mask is dense within a range
Expand All @@ -151,13 +149,8 @@ impl LayoutReader for FlatReader {
let array_mask = if *USE_VORTEX_OPERATORS {
// Apply the expression to the array.
let array = array.apply(&expr)?;

tracing::debug!("Filter Array:\n{}", array.display_tree());
let array = optimizer.optimize_array(&array)?;
tracing::info!("Optimized Filter Array:\n{}", array.display_tree());

// Evaluate the array into a mask.
let array_mask = array.execute_mask(&session)?;
let array_mask = array.execute_mask_optimized(&session)?;
mask.bitand(&array_mask)
} else {
// TODO(ngates): the mask may actually be dense within a range, as is often the case when
Expand Down Expand Up @@ -213,7 +206,6 @@ impl LayoutReader for FlatReader {
let name = self.name.clone();
let array = self.array_future();
let expr = expr.clone();
let optimizer = self.session.arrays().optimizer().clone();

Ok(async move {
tracing::debug!("Flat array evaluation {} - {}", name, expr);
Expand All @@ -235,9 +227,6 @@ impl LayoutReader for FlatReader {
array = array.filter(mask)?;
}

tracing::debug!("Project Array:\n{}", array.display_tree());
let array = optimizer.optimize_array(&array)?;
tracing::info!("Optimized Project Array:\n{}", array.display_tree());
array
} else {
// Filter the array based on the row mask.
Expand Down
Loading