Skip to content

Cast pushdown for duckdb#8620

Open
myrrc wants to merge 2 commits into
developfrom
myrrc/duckdb-cast-pushdown
Open

Cast pushdown for duckdb#8620
myrrc wants to merge 2 commits into
developfrom
myrrc/duckdb-cast-pushdown

Conversation

@myrrc

@myrrc myrrc commented Jun 29, 2026

Copy link
Copy Markdown
Contributor
  • Backport of Push down type casts to file readers duckdb/duckdb#22788 to push down casts, optimizer pass. Extract both passes common parts to optimizer.cpp
  • Map 8- and 16-bit types in sqllogictest runner to INTEGER.
  • Add tracing subscriber logging to sqllogictest runner to support RUST_LOG=debug.
  • Support of cast pushdown on Rust side. U128/I128 are not pushed.

Depends on #8621

@myrrc myrrc added changelog/feature A new feature ext/duckdb Relates to the DuckDB integration labels Jun 29, 2026
@myrrc myrrc linked an issue Jun 29, 2026 that may be closed by this pull request
6 tasks
@myrrc myrrc marked this pull request as ready for review June 29, 2026 13:14
@myrrc myrrc requested review from a team and 0ax1 June 29, 2026 13:14
@myrrc myrrc force-pushed the myrrc/duckdb-cast-pushdown branch from a3ecf3a to 2ae987d Compare June 29, 2026 13:17
Signed-off-by: Mikhail Kot <mikhail@spiraldb.com>
@codspeed-hq

codspeed-hq Bot commented Jun 29, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 20.87%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 4 improved benchmarks
❌ 1 regressed benchmark
✅ 1590 untouched benchmarks
⏩ 4 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation slice_empty_vortex 339.4 ns 397.8 ns -14.66%
Simulation chunked_bool_canonical_into[(1000, 10)] 26.9 µs 15.9 µs +69.52%
Simulation bitwise_not_vortex_buffer_mut[128] 273.6 ns 215.3 ns +27.1%
Simulation bitwise_not_vortex_buffer_mut[1024] 333.9 ns 275.6 ns +21.17%
Simulation bitwise_not_vortex_buffer_mut[2048] 427.8 ns 369.4 ns +15.79%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing myrrc/duckdb-cast-pushdown (c7fd89e) with develop (00c39e8)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@myrrc myrrc force-pushed the myrrc/duckdb-cast-pushdown branch from 2ae987d to c7fd89e Compare June 29, 2026 13:17
@0ax1

0ax1 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What about constant+bool arrays?

.cast(DType::Primitive(target, Nullability::NonNullable))
.unwrap();
let out = out.execute::<Canonical>(&mut ctx).unwrap().into_array();
assert_eq!(out.len(), 3);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only assert the length here not the type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature ext/duckdb Relates to the DuckDB integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Epic: Duckdb projection expression pushdown

2 participants