Skip to content

Commit 47d6ba7

Browse files
feat[duckdb]: optimize array (#5738)
Signed-off-by: Joe Isaacs <[email protected]>
1 parent c93f06e commit 47d6ba7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vortex-duckdb/src/scan.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use url::Url;
2626
use vortex::VortexSessionDefault;
2727
use vortex::array::ArrayRef;
2828
use vortex::array::ToCanonical;
29+
use vortex::array::optimizer::ArrayOptimizer;
2930
use vortex::dtype::FieldNames;
3031
use vortex::error::VortexExpect;
3132
use vortex::error::VortexResult;
@@ -43,6 +44,7 @@ use vortex::file::VortexFile;
4344
use vortex::file::VortexOpenOptions;
4445
use vortex::io::runtime::BlockingRuntime;
4546
use vortex::io::runtime::current::ThreadSafeIterator;
47+
use vortex::layout::layouts::USE_VORTEX_OPERATORS;
4648
use vortex::session::VortexSession;
4749

4850
use crate::RUNTIME;
@@ -327,6 +329,12 @@ impl TableFunction for VortexTableFunction {
327329

328330
let (array_result, conversion_cache) = result?;
329331

332+
let array_result = if *USE_VORTEX_OPERATORS {
333+
array_result.optimize_recursive()?
334+
} else {
335+
array_result
336+
};
337+
330338
local_state.exporter = Some(ArrayExporter::try_new(
331339
&array_result.to_struct(),
332340
&conversion_cache,

0 commit comments

Comments
 (0)