Skip to content

Commit af0af75

Browse files
Reduce optimizer logging to debug (#5702)
Signed-off-by: Joe Isaacs <[email protected]> Signed-off-by: Nicholas Gates <[email protected]> Co-authored-by: Joe Isaacs <[email protected]>
1 parent d12c41b commit af0af75

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

encodings/runend/src/rules.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@ impl ArrayParentReduceRule<Exact<RunEndVTable>, AnyScalarFn> for RunEndScalarFnR
7373
.into_array();
7474

7575
Ok(Some(
76-
RunEndArray::try_new_offset_length(
77-
run_end.ends().clone(),
78-
new_values,
79-
run_end.offset(),
80-
run_end.len(),
81-
)?
76+
unsafe {
77+
RunEndArray::new_unchecked(
78+
run_end.ends().clone(),
79+
new_values,
80+
run_end.offset(),
81+
run_end.len(),
82+
)
83+
}
8284
.into_array(),
8385
))
8486
}

vortex-array/src/optimizer/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ impl ArrayOptimizer {
8787
// No real reason to pick 4.
8888
let max_iterations = array.depth_first_traversal().count() * 4;
8989

90-
inner(self, array, max_iterations)
90+
tracing::debug!("Starting array optimization\n{}", array.display_tree());
91+
let array = inner(self, array, max_iterations)?;
92+
tracing::debug!("Optimized array\n{}", array.display_tree());
93+
94+
Ok(array)
9195
}
9296

9397
/// Register a reduce rule for a specific array encoding.

vortex-layout/src/layouts/flat/reader.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use vortex_array::expr::Expression;
1616
use vortex_array::expr::Root;
1717
use vortex_array::mask::MaskExecutor;
1818
use vortex_array::serde::ArrayParts;
19-
use vortex_array::session::ArraySessionExt;
2019
use vortex_dtype::DType;
2120
use vortex_dtype::FieldMask;
2221
use vortex_error::VortexExpect;
@@ -134,7 +133,6 @@ impl LayoutReader for FlatReader {
134133
let array = self.array_future();
135134
let expr = expr.clone();
136135
let session = self.session.clone();
137-
let optimizer = self.session.arrays().optimizer().clone();
138136

139137
Ok(MaskFuture::new(mask.len(), async move {
140138
// TODO(ngates): if the mask density is low enough, or if the mask is dense within a range
@@ -151,13 +149,8 @@ impl LayoutReader for FlatReader {
151149
let array_mask = if *USE_VORTEX_OPERATORS {
152150
// Apply the expression to the array.
153151
let array = array.apply(&expr)?;
154-
155-
tracing::debug!("Filter Array:\n{}", array.display_tree());
156-
let array = optimizer.optimize_array(&array)?;
157-
tracing::info!("Optimized Filter Array:\n{}", array.display_tree());
158-
159152
// Evaluate the array into a mask.
160-
let array_mask = array.execute_mask(&session)?;
153+
let array_mask = array.execute_mask_optimized(&session)?;
161154
mask.bitand(&array_mask)
162155
} else {
163156
// TODO(ngates): the mask may actually be dense within a range, as is often the case when
@@ -213,7 +206,6 @@ impl LayoutReader for FlatReader {
213206
let name = self.name.clone();
214207
let array = self.array_future();
215208
let expr = expr.clone();
216-
let optimizer = self.session.arrays().optimizer().clone();
217209

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

238-
tracing::debug!("Project Array:\n{}", array.display_tree());
239-
let array = optimizer.optimize_array(&array)?;
240-
tracing::info!("Optimized Project Array:\n{}", array.display_tree());
241230
array
242231
} else {
243232
// Filter the array based on the row mask.

0 commit comments

Comments
 (0)