Repository navigation
Branch 56 - #211
Draft
Rich-T-kid wants to merge 1210 commits into
Draft
Branch 56#211Rich-T-kid wants to merge 1210 commits into
Rich-T-kid wants to merge 1210 commits into
Conversation
## Which issue does this PR close? - Closes apache#25950. ## Rationale for this change Calling array_repeat on a list column whose element field is non-nullable, or not named item (element is common in external schemas), returns an Arrow error instead of a result. Plain List(Int64) works. LargeList fails the same way. ## What changes are included in this PR? When the first argument is a list, array_repeat rebuilt each repeated inner list with a fresh nullable item field. The outer list, and return_type, declare the inner type as the input type, so Arrow rejected the mismatch. The inner list now reuses the input's own element field, so the built array matches the planned return type, for example List(List(non-null Int64)). ## What is the testing strategy for this PR? New cases in array/array_repeat.slt cover non-null and element-named fields for List and LargeList, checking both values and arrow_typeof. They fail on main with the error below. End to end with datafusion-cli: ```sql CREATE TABLE t AS SELECT make_array(1, 2) AS a, arrow_cast(make_array(1, 2), 'List(non-null Int64)') AS b, arrow_cast(make_array(1, 2), 'List(Int64, field: ''element'')') AS c, arrow_cast(make_array(1, 2), 'LargeList(non-null Int64)') AS d; SELECT array_repeat(b, 2) FROM t; SELECT array_repeat(c, 2) FROM t; SELECT array_repeat(d, 2) FROM t; ``` ``` $ ./target/debug/datafusion-cli -f repro.sql ``` Before (main): ``` Arrow error: Invalid argument error: ListArray expected data type List(non-null Int64) got List(Int64) for "item" Arrow error: Invalid argument error: ListArray expected data type List(Int64, field: 'element') got List(Int64) for "item" Arrow error: Invalid argument error: LargeListArray expected data type LargeList(non-null Int64) got LargeList(Int64) for "item" ``` After: ``` +----------------------------+ | array_repeat(t.b,Int64(2)) | +----------------------------+ | [[1, 2], [1, 2]] | +----------------------------+ +----------------------------+ | array_repeat(t.c,Int64(2)) | +----------------------------+ | [[1, 2], [1, 2]] | +----------------------------+ +----------------------------+ | array_repeat(t.d,Int64(2)) | +----------------------------+ | [[1, 2], [1, 2]] | +----------------------------+ ``` ## Are there any user-facing changes? array_repeat now works on lists with non-nullable or custom-named element fields. No API changes. --------- Signed-off-by: 1fanwang <1fannnw@gmail.com> Co-authored-by: Neil Conway <neil.conway@gmail.com>
…6245) ## Which issue does this PR close? - Part of apache#21706 ## Rationale for this change Add the existing sort pushdown workloads to the SQL benchmark runner as a standalone suite. ## What changes are included in this PR? Add 30 cases across `baseline`, `sorted`, `inexact`, `inexact_unsorted`, and `inexact_overlap`, with suite metadata, table registration SQL, and usage documentation. The cases reference the existing query files and reuse the existing Parquet datasets. The suite preserves the legacy ordering declarations, statistics collection, and inexact filter-pushdown settings. Data generation remains in the unchanged `bench.sh`; the legacy benchmark remains available. The known result-validation ordering issue is outside this change. ## What is the testing strategy for this PR? Compared the SQL and legacy runners on the same datasets using two rounds of five iterations per case, reversing runner order for the second round (600 timed executions). All row counts matched. The sums of per-case median times differed by -0.6%, -0.1%, +4.4%, -3.9%, and -6.6% across the five subgroups, respectively. Focused rechecks resolved two timing outliers; sorted query 2 remained about 16% faster in the SQL runner at roughly 2 ms. A separate verifier found matching physical plans for all 30 cases and correctly ordered outputs. - All 30 SQL/native query pairs passed with matching row counts and identical physical plans. - 28/30 returned identical rows, ignoring order. - inexact_overlap Q01 and Q03 each selected one different row at the LIMIT 100 boundary: four rows tie on l_orderkey, but only three fit. Both results are valid. Adding a temporary tie-breaker made them match exactly. - All 35 common-flag comparisons returned identical rows, covering partitions, batch size, memory pools/limits, spill reservation, and simulated latency. - The Criterion run passed, as did result persistence and validation checks. Release builds, documentation formatting, and `git diff --check` passed. ## Are there any user-facing changes? The standalone suite is available from `benchmarks/` with: ```bash cargo run --release --bin benchmark_runner -- sort_pushdown --iterations 5 ``` Use `--subgroup` and `--query` to select a variant and original query number. --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
## Which issue does this PR close? - Closes apache#25823. ## Rationale for this change Applications embedding DataFusion may want to allow DML operations such as INSERT into registered table providers while disallowing COPY, which writes query results to a file or object store. SQLOptions currently controls COPY through allow_dml, so COPY cannot be disabled without also disabling other DML. ## What changes are included in this PR? - Add SQLOptions::with_allow_copy to control COPY independently, defaulting to true. - Keep with_allow_dml(false) behavior unchanged so it continues to reject COPY. - Add an integration test showing that disabling COPY does not disable INSERT. ## What is the testing strategy for this PR? - cargo fmt --all -- --check - cargo clippy --all-targets --all-features -- -D warnings - cargo test -p datafusion --test core_integration -- sql::sql_api::copy_can_be_disabled_independently_from_dml --exact - cargo test -p datafusion --test core_integration -- sql::sql_api::unsupported_copy_returns_error --exact ## Are there any user-facing changes? Yes. This adds the public SQLOptions::with_allow_copy builder method. It is backwards compatible because COPY remains enabled by default and with_allow_dml(false) continues to reject COPY.
Bumps [certifi](https://github.com/certifi/python-certifi) from 2026.1.4 to 2026.10.19. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/certifi/python-certifi/commit/662df63d7906df66f1f07c0751a3dfe9da14d914"><code>662df63</code></a> Restore unaffected emSign roots (<a href="https://redirect.github.com/certifi/python-certifi/issues/439">#439</a>) (<a href="https://redirect.github.com/certifi/python-certifi/issues/440">#440</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/5cb238caeeb6c30ec1a7309ad3e16a5aa7b10ce8"><code>5cb238c</code></a> Remove emsign (<a href="https://redirect.github.com/certifi/python-certifi/issues/437">#437</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/69494a764d0a08f90838d53d4b0fefd3e84045d6"><code>69494a7</code></a> Bump actions/download-artifact from 8.0.1 to 8.0.2 (<a href="https://redirect.github.com/certifi/python-certifi/issues/436">#436</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/029c7b0913d79e2efb73a216fc5c5e13ef958536"><code>029c7b0</code></a> Bump actions/upload-artifact from 7.0.1 to 7.0.2 (<a href="https://redirect.github.com/certifi/python-certifi/issues/435">#435</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/9d0a8f1f3a0d6b2e38d5773db7afe1a37e4527b6"><code>9d0a8f1</code></a> Add support for Python 3.15 (<a href="https://redirect.github.com/certifi/python-certifi/issues/432">#432</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/db472abf0a37067cb4488f036f4c19adf6b6ec3c"><code>db472ab</code></a> Bump pypa/gh-action-pypi-publish from 1.14.1 to 1.14.2 (<a href="https://redirect.github.com/certifi/python-certifi/issues/431">#431</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/f4bc676bc101fe2235846e37044e8c693d6cbaf4"><code>f4bc676</code></a> 2026.07.22 (<a href="https://redirect.github.com/certifi/python-certifi/issues/428">#428</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/4c91f9c5f9b4676d40d2930025ba04d80dd536f6"><code>4c91f9c</code></a> Bump actions/setup-python from 6.3.0 to 7.0.0 (<a href="https://redirect.github.com/certifi/python-certifi/issues/427">#427</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/01a66c5cf32eadb8f03a0504c24cb44f6d581248"><code>01a66c5</code></a> Bump actions/checkout from 7.0.0 to 7.0.1 (<a href="https://redirect.github.com/certifi/python-certifi/issues/426">#426</a>)</li> <li><a href="https://github.com/certifi/python-certifi/commit/eb355f41cb71f71012ecf1a4d27a57d0ee2b1337"><code>eb355f4</code></a> Bump pypa/gh-action-pypi-publish from 1.14.0 to 1.14.1 (<a href="https://redirect.github.com/certifi/python-certifi/issues/425">#425</a>)</li> <li>Additional commits viewable in <a href="https://github.com/certifi/python-certifi/compare/2026.01.04...2026.10.19">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/apache/datafusion/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…wasmtest/datafusion-wasm-app (apache#26547) Bumps [launch-editor](https://github.com/vitejs/launch-editor) from 2.14.1 to 2.14.2. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/vitejs/launch-editor/commit/b5334895a00f8000ef3b6a46f2aa9e1a62eb27b4"><code>b533489</code></a> v2.14.2</li> <li><a href="https://github.com/vitejs/launch-editor/commit/f13cd835d4b8e860b1d4d080ad8a490cc2463679"><code>f13cd83</code></a> fix: check file existence after path resolution (<a href="https://redirect.github.com/vitejs/launch-editor/issues/157">#157</a>)</li> <li><a href="https://github.com/vitejs/launch-editor/commit/f6e6701bb1f16f2dd242b321374f1b6cca6eb6d4"><code>f6e6701</code></a> fix: ensure filenames passed to editors are not considered as flags (<a href="https://redirect.github.com/vitejs/launch-editor/issues/156">#156</a>)</li> <li><a href="https://github.com/vitejs/launch-editor/commit/3c2f9bf2ff8fe63d056a8f9cc52d825b66ca79fc"><code>3c2f9bf</code></a> fix: reject paths containing <code>%</code> on windows (<a href="https://redirect.github.com/vitejs/launch-editor/issues/155">#155</a>)</li> <li><a href="https://github.com/vitejs/launch-editor/commit/ecdfce1f9ec56a9c08f225f27d8047f3cf9690b1"><code>ecdfce1</code></a> refactor: extract <code>constructWindowsLaunchCommand</code> (<a href="https://redirect.github.com/vitejs/launch-editor/issues/154">#154</a>)</li> <li><a href="https://github.com/vitejs/launch-editor/commit/24d5d8442a022a83c9c9c486b18a3bc4236cf45a"><code>24d5d84</code></a> fix: correctly show error when the third parameter is not passed (<a href="https://redirect.github.com/vitejs/launch-editor/issues/153">#153</a>)</li> <li><a href="https://github.com/vitejs/launch-editor/commit/7bae9bc13120ccc8c9d8a94204a63f0bf3bb33d7"><code>7bae9bc</code></a> refactor: merge statements</li> <li><a href="https://github.com/vitejs/launch-editor/commit/571fe00a626450649af519247a33aabe8ea246a6"><code>571fe00</code></a> chore(deps): update actions/setup-node action to v7 (<a href="https://redirect.github.com/vitejs/launch-editor/issues/149">#149</a>)</li> <li><a href="https://github.com/vitejs/launch-editor/commit/d8ed4233db1fc1f82164f12635c65fe54aaf758c"><code>d8ed423</code></a> chore(deps): update actions/checkout action to v7 (<a href="https://redirect.github.com/vitejs/launch-editor/issues/148">#148</a>)</li> <li><a href="https://github.com/vitejs/launch-editor/commit/75b3e6ce27309d5f005769e68deaa94c090cb61d"><code>75b3e6c</code></a> fix(deps): update all non-major dependencies (<a href="https://redirect.github.com/vitejs/launch-editor/issues/146">#146</a>)</li> <li>Additional commits viewable in <a href="https://github.com/vitejs/launch-editor/compare/v2.14.1...v2.14.2">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/apache/datafusion/network/alerts). </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
## Which issue does this PR close? - Closes apache#26172. ## Rationale for this change When a required child is missing from one Parquet file but its containing struct exists in both files, schema inference leaves the child non-nullable. Selecting that child then fails, and an `IS NULL` predicate can incorrectly return no rows. With this change, selecting `s.y` returns `10` and `NULL`, and `WHERE s.y IS NULL` returns the row from the file without `y`. ## What changes are included in this PR? ### Implementation - Extend partial-field nullability correction recursively through structs, lists, and large lists. - Compare children only across schemas containing their parent. A missing parent becomes nullable without weakening required children or list elements; a missing struct child within a present parent becomes nullable. - Preserve existing field/schema metadata and existing nullability. Other container types retain their current merge behavior. - Keep the identical-schema path inexpensive by returning early when the recursive field trees are equal, both at the schema root and within unchanged nested levels. - Treat a missing occurrence-list entry defensively as an absent field instead of indexing the map directly. ### Performance - A fresh optimized synthetic rerun compared local PR head `c14317f1f` with current `upstream/main` at `cdc2fc041`. Identical flat schemas were faster in the PR build: 32 files x 128 fields took 1.737 -> 1.650 ms (-4.99%), and 256 files x 1,024 fields took 317.490 -> 308.674 ms (-2.78%). - Evolving nested schemas retained a small inference cost: 32 files x 128 children took 1.925 -> 1.966 ms (+2.11%, approximately 0.041 ms), and 256 files x 128 children took 15.610 -> 16.557 ms (+6.07%, approximately 0.947 ms). - An isolated pre-review/post-review comparison on the same base confirmed that the recursive-equality fast path improved the two identical-schema cases by 2.78% and 1.18%. Evolving nested cases cannot take that shortcut and were 5.19% and 7.75% slower in this rerun. - Each reported value is the median of three process medians; each process used 5 warm-ups followed by 40 measured schema-inference calls. Measurements used an Apple M4 Mac Mini, `release-nonlto`, in-memory one-row Parquet files, and warmed metadata. - The benchmark isolates schema inference. It does not measure production query throughput or establish statistical significance. The change adds no footer reads and no scan-time correction pass. - [Benchmark methodology and detailed results](https://drive.google.com/file/d/1Vx-ya0ZjglcwX1VzI6YutT403DyZqvuR/view?usp=sharing) — synthetic data, experiment setup, timings, and limitations. (Benchmark preparation and report drafting assisted by Codex) ## What is the testing strategy for this PR? - Unit tests cover missing nested children, absent parents, independent nested paths, metadata preservation, required list elements, and the defensive missing-map-entry path. - A Parquet integration regression checks struct/list/large-list projection and `IS NULL` across 12 configurations (metadata and filter pushdown on/off). It fails without the fix. - A SQL logic regression verifies that a missing child projects as `NULL` and that `IS NULL` returns the corresponding row. - Focused unit, Parquet integration, and SQL logic tests passed. - All 534 SQL logic test files passed. - Extended workspace Rust tests passed with the repository's required feature set. Four path-sensitive snapshot cases also passed after rerunning with canonical workspace environment paths. - `cargo fmt --all` passed. The repository lint workflow completed through the available checks; documentation HTML generation was blocked locally by a missing `cargo-depgraph` integration. The literal all-target/all-feature Clippy command reports three pre-existing `mutable_key_type` errors in unchanged upstream optimizer code. ## Are there any user-facing changes? Inferred nested fields that are absent from some containing Parquet schemas now become nullable. This allows missing values to be read as `NULL` and makes `IS NULL` queries return the correct rows. Explicit schemas and public APIs are unchanged.
## Which issue does this PR close? - Closes apache#24337. ## Rationale for this change When using a projection as the percentile argument to `approx_percentile_cont` or `percentile_cont`, planning fails because only literals are supported. It makes sense to accept projections that are constant across all batches but not labelled as literals (although they practically are). For example, this query cannot be planned, even though the percentile is constant: ``` SELECT approx_percentile_cont(y, m) AS median FROM ( SELECT t.x + 1 as y, 0.5 as m FROM ( VALUES (10) ) AS t(x) ) ``` ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here, but it is sometimes worth providing a summary of the individual changes in this PR. --> Introduce `PercentileParam` and `PercentileParamState` to handle column references or projections for the percentile argument. Resolution of `percentile` cannot always be done: for example, on an empty record batch, we won't be able to get the value from the columns. `PercentileParamState` makes sure the percentile resolution is both flexible enough to wait to be able to resolve the parameter AND applies the strict constraints that are required (constant `Float32` or `Float64`). The percentile is also included in state fields so that the merge_batch in the final Accumulator can process without any issues. ## What is the testing strategy for this PR? This new feature is covered by the `sqllogictest` cases added in `aggregate.slt`. Unit tests have also been added to `approx_percentile_cont.rs` and `percentile_cont.rs`. ## Are there any user-facing changes? No breaking changes. ## Benchark: ClickBench | Query | main | annarose_approx_percentile | Change | | ---------- | ---------- | ---------- | ---------- | | QQuery 0 | 0.73 ms | 0.79 ms | 1.08x slower | | QQuery 1 | 8.10 ms | 8.91 ms | 1.10x slower | | QQuery 2 | 27.90 ms | 30.59 ms | 1.10x slower | | QQuery 3 | 23.27 ms | 23.89 ms | no change | | QQuery 4 | 157.25 ms | 157.70 ms | no change | | QQuery 5 | 197.65 ms | 201.26 ms | no change | | QQuery 6 | 0.72 ms | 0.67 ms | +1.08x faster | | QQuery 7 | 8.20 ms | 8.28 ms | no change | | QQuery 8 | 230.84 ms | 215.32 ms | +1.07x faster | | QQuery 9 | 296.27 ms | 312.37 ms | 1.05x slower | | QQuery 10 | 49.12 ms | 47.66 ms | no change | | QQuery 11 | 58.86 ms | 55.26 ms | +1.07x faster | | QQuery 12 | 198.45 ms | 192.95 ms | no change | | QQuery 13 | 285.28 ms | 280.02 ms | no change | | QQuery 14 | 195.67 ms | 204.80 ms | no change | | QQuery 15 | 184.29 ms | 180.74 ms | no change | | QQuery 16 | 434.20 ms | 457.81 ms | 1.05x slower | | QQuery 17 | 476.52 ms | 427.84 ms | +1.11x faster | | QQuery 18 | 912.71 ms | 881.69 ms | no change | | QQuery 19 | 18.14 ms | 19.41 ms | 1.07x slower | | QQuery 20 | 456.87 ms | 463.23 ms | no change | | QQuery 21 | 468.67 ms | 482.15 ms | no change | | QQuery 22 | 892.28 ms | 896.13 ms | no change | | QQuery 23 | 2520.93 ms | 2558.49 ms | no change | | QQuery 24 | 34.14 ms | 33.50 ms | no change | | QQuery 25 | 99.14 ms | 99.83 ms | no change | | QQuery 26 | 35.25 ms | 34.51 ms | no change | | QQuery 27 | 467.74 ms | 484.36 ms | no change | | QQuery 28 | 1931.71 ms | 1945.50 ms | no change | | QQuery 29 | 29.16 ms | 30.35 ms | no change | | QQuery 30 | 214.69 ms | 209.17 ms | no change | | QQuery 31 | 196.43 ms | 199.65 ms | no change | | QQuery 32 | 583.78 ms | 614.36 ms | 1.05x slower | | QQuery 33 | 1078.73 ms | 1145.79 ms | 1.06x slower | | QQuery 34 | 1073.15 ms | 1117.56 ms | no change | | QQuery 35 | 182.87 ms | 171.52 ms | +1.07x faster | | QQuery 36 | 46.27 ms | 47.18 ms | no change | | QQuery 37 | 24.27 ms | 24.03 ms | no change | | QQuery 38 | 29.58 ms | 29.76 ms | no change | | QQuery 39 | 85.29 ms | 86.14 ms | no change | | QQuery 40 | 8.23 ms | 8.41 ms | no change | | QQuery 41 | 8.12 ms | 8.47 ms | no change | | QQuery 42 | 6.72 ms | 6.81 ms | no change | | Benchmark Summary | | | ---- | ---- | | Total Time (main) | 14238.19ms | | Total Time (annarose_approx_percentile) | 14404.87ms | | Average Time (main) | 331.12ms | | Average Time (annarose_approx_percentile) | 335.00ms | | Queries Faster | 5 | | Queries Slower | 8 | | Queries with No Change | 30 | | Queries with Failure | 0 | ## Memory profiling for clickbench_partitioned ### this branch |Query | Time (ms) | Peak RSS | Peak Commit | Major Page Faults| |--------|----------------|-------------|--------------|-------------| |0|5.43|84.0 MB|171.8 MB|0| |1|11.45|119.6 MB|313.9 MB|0| |2|27.44|240.8 MB|1536.1 MB|0| |3|30.52|412.3 MB|1227.9 MB|0| |4|173.88|2.8 GB|3.2 GB|0| |5|193.60|2.5 GB|2.9 GB|0| |6|3.36|93.0 MB|167.9 MB|0| |7|10.66|128.1 MB|318.8 MB|0| |8|219.80|3.4 GB|4.1 GB|0| |9|268.65|2.4 GB|3.2 GB|0| |10|45.84|780.3 MB|1809.8 MB|0| |11|52.68|788.7 MB|1800.9 MB|0| |12|183.80|2.5 GB|2.9 GB|0| |13|266.55|3.0 GB|3.5 GB|0| |14|191.93|2.4 GB|3.2 GB|0| |15|185.03|3.0 GB|3.3 GB|0| |16|422.42|6.4 GB|7.1 GB|0| |17|404.75|6.1 GB|6.9 GB|0| |18|861.29|12.2 GB|13.1 GB|0| |19|19.20|362.3 MB|1118.0 MB|24| |20|442.22|1171.1 MB|1429.2 MB|0| |21|407.55|1836.8 MB|2.1 GB|0| |22|763.73|2.5 GB|2.8 GB|0| |23|2313.37|4.8 GB|5.5 GB|0| |24|33.92|569.7 MB|959.2 MB|5| |25|82.99|798.0 MB|1517.9 MB|0| |26|35.10|599.1 MB|986.8 MB|0| |27|392.34|1234.9 MB|1455.8 MB|0| |28|1714.18|2.5 GB|2.7 GB|0| |29|28.43|229.9 MB|1497.1 MB|0| |30|191.47|2.2 GB|3.3 GB|0| |31|182.56|2.8 GB|3.7 GB|0| |32|1263.74|13.3 GB|16.2 GB|0| |33|958.16|10.7 GB|10.9 GB|5| |34|956.65|10.6 GB|10.9 GB|0| |35|171.08|2.1 GB|2.6 GB|0| |36|47.33|452.0 MB|800.8 MB|0| |37|26.89|229.4 MB|544.9 MB|0| |38|33.62|270.9 MB|503.8 MB|0| |39|90.83|756.9 MB|1062.6 MB|0| |40|11.41|208.3 MB|433.3 MB|0| |41|11.47|170.3 MB|393.8 MB|0| |42|10.48|142.8 MB|265.1 MB|0| ### main |Query | Time (ms) | Peak RSS | Peak Commit |Major Page Faults| |----------|--------------|------------|----------------|------------| |0|4.76|94.7 MB|171.5 MB|0| |1|11.22|120.7 MB|296.7 MB|0| |2|32.05|244.2 MB|1533.8 MB|0| |3|24.33|417.7 MB|1229.2 MB|0| |4|175.85|2.8 GB|3.2 GB|0| |5|207.07|2.5 GB|3.0 GB|0| |6|3.46|94.3 MB|171.6 MB|0| |7|11.08|129.4 MB|323.5 MB|0| |8|223.08|3.4 GB|4.1 GB|0| |9|288.63|2.4 GB|3.4 GB|0| |10|48.79|792.1 MB|1767.0 MB|0| |11|53.32|760.8 MB|1779.6 MB|0| |12|189.17|2.6 GB|3.1 GB|0| |13|274.96|3.0 GB|3.7 GB|0| |14|202.74|2.6 GB|3.3 GB|0| |15|208.83|3.0 GB|3.4 GB|0| |16|576.37|6.3 GB|7.1 GB|0| |17|623.87|6.5 GB|7.3 GB|0| |18|1140.54|11.3 GB|13.1 GB|0| |19|21.20|370.8 MB|1124.9 MB|26| |20|507.91|1149.3 MB|1364.8 MB|0| |21|479.85|1824.8 MB|2.1 GB|0| |22|914.26|2.3 GB|2.7 GB|0| |23|2757.47|4.6 GB|5.3 GB|0| |24|41.85|591.0 MB|999.1 MB|0| |25|91.00|763.3 MB|1500.8 MB|0| |26|38.90|560.1 MB|980.6 MB|0| |27|506.23|1319.5 MB|1550.4 MB|0| |28|2119.47|2.6 GB|2.7 GB|0| |29|34.79|213.7 MB|1267.2 MB|0| |30|218.63|2.1 GB|3.1 GB|0| |31|212.42|2.8 GB|3.7 GB|0| |32|821.63|13.0 GB|16.1 GB|0| |33|1162.42|10.5 GB|10.7 GB|14| |34|1212.91|10.4 GB|10.6 GB|0| |35|184.71|2.0 GB|2.5 GB|0| |36|58.35|469.5 MB|845.9 MB|0| |37|30.78|240.2 MB|545.1 MB|0| |38|35.43|287.3 MB|485.4 MB|0| |39|92.89|730.8 MB|1074.5 MB|0| |40|11.87|204.7 MB|420.5 MB|0| |41|11.43|171.2 MB|401.5 MB|0| |42|10.57|146.6 MB|275.6 MB|0|
## Which issue does this PR close? - Closes apache#26506. ## Rationale for this change A named window in `HAVING` was never resolved, so `MAX(price) OVER w` was planned as a plain aggregate and the query returned rows instead of being rejected. An undefined window name in `HAVING` was not reported either. ## What changes are included in this PR? Resolve named windows in `HAVING` together with the other clauses. The query now fails like the inline form (`Window function calls are not allowed in HAVING`), and an undefined name reports `The window ... is not defined!`. This builds on apache#26400, which makes the resolver usable for any clause. Only the last commit is new; the diff shrinks to it once apache#26400 merges. ## Are these changes tested? Yes, `window.slt` cases for `HAVING` (inline, named, undefined name) and `WHERE` (inline, named). The `HAVING` cases fail without the fix. ## Are there any user-facing changes? Queries that used a named window in `HAVING` now return an error instead of wrong results.
…6370) ## Which issue does this PR close? Closes apache#26369. Follow-up to apache#25150. ## Rationale for this change Fully ordered multi-column `GROUP BY` still hashes temporal, decimal, and fixed-size binary keys. These types can use the existing adjacent-run grouping path because Arrow's adjacent equality agrees with the grouping builders. In our production usecases, we are especially interested in apache#26369's optimization extending to `Timestamp`s (timeseries data) and `FixedSizeBinary(16)` (for UUIDs). ## What changes are included in this PR? - **Only production code change is 12 new types** added to the `match` under `supports_schema`: the rest are tests and benches. - Enable timestamps with all units and timezone metadata, dates, valid time units, durations, intervals, Decimal32/64/128/256, and every valid fixed-size binary width. - Preserve type metadata and the existing selection of single-column specializations. - Add a `fully_ordered` group to the existing SQL aggregation Criterion benchmark, with integer/string controls, timestamp run-length variants, and a timestamp `SUM(v)` case. The first two commits contain only benchmarks, followed by the type expansion and regression tests, including the UUID coverage. ## What is the testing strategy for this PR? Differential tests compare ordered and hash grouping across nulls, units/timezones, decimal metadata, sliced batches, and group emission. Dedicated tests cover zero-width binary and 16-byte binary keys that share their first 15 bytes, including cross-batch continuation and keys that differ only in the last byte. SQL regression tests cover single-stage and partial/final aggregation, mixed sort directions, null ordering, and aggregate filters. The benchmarks check input types, row and group counts, and fully clustered aggregation without sorting or repartitioning in the measured query. The timestamp `SUM(v)` case also checks every group's sum before timing. <details> <summary>SQL benchmark results</summary> [Latest benchmark bot report](apache#26370 (comment)), comparing the benchmark-only baseline `dc6a10cf3c8` with `a398f8768ca`. Both refs contain the same 17 benchmark cases. The table shows rounded speedups from the report. The controls are roughly unchanged; the small differences may be benchmark noise. Values below 1× mean slower. | Second grouping key / query | Rows per group | Approx. speedup | | --- | ---: | ---: | | Int64 (control) | 31 | ~0.95× | | Utf8View (control) | 31 | ~0.99× | | Timestamp (ns) | 31 | ~7.0× | | Timestamp (µs, UTC) | 31 | ~6.9× | | Date32 | 31 | ~7.5× | | Time32 (ms) | 31 | ~7.5× | | Time64 (ns) | 31 | ~7.0× | | Duration (ns) | 31 | ~7.0× | | Interval (day/time) | 31 | ~6.4× | | Interval (month/day/ns) | 31 | ~5.3× | | Decimal128(30, 4) | 31 | ~6.1× | | Decimal256(60, 4) | 31 | ~5.2× | | FixedSizeBinary(16) | 31 | ~4.6× | | FixedSizeBinary(7) | 31 | ~4.4× | | Timestamp (ns), singleton groups | 1 | ~2.9× | | Timestamp (ns), long groups | 512 | ~7.7× | | Timestamp (ns), `SUM(v)` | 31 | ~4.0× | The 16 key-only cases use the same two-key deduplication query: ```sql SELECT k1, k2 FROM ordered_input GROUP BY k1, k2 ``` The additional timestamp case includes accumulator work: ```sql SELECT k1, k2, SUM(v) FROM ordered_input GROUP BY k1, k2 ``` Here `v` is the nonconstant source row number. The timestamp `SUM(v)` case improved from approximately 43.9 ms to 11.0 ms (~4.0×). - **Input:** about 2.1 million rows. `k1` is an Int32 prefix that advances every 32 groups; nullable `k2` cycles through 32 values, including one null, using the type listed above. Both keys vary. - **Group sizes:** normally 31 rows per key pair, so runs cross the 8,192-row batch boundaries. The additional timestamp cases use one or 512 rows per group to vary cardinality. - **Before timing:** generate the data, sort by both keys, and materialize it into one in-memory partition with its ordering declared to the planner. - **Measured work:** SQL planning, query execution, and collection of all results. The key-only cases focus on grouping the keys; the timestamp `SUM(v)` case also updates an accumulator. - **Setup checks:** verify input type, row count, and output group count; require fully clustered aggregation and fail if the measured plan adds sorting or repartitioning. The `SUM(v)` case verifies every group's result, including null timestamp keys and the final short group, before timing. </details> ## Are there any user-facing changes? Already-sorted multi-column aggregations can use lower-overhead key storage for these types. Query results stay the same. Developed with AI assistance.
…e `ProtoDecoderRegistry` (apache#26353) ## Which issue does this PR close? - Follow-up to apache#24631. No separate issue. ## Rationale for this change A session carries one `ProtoDecoderRegistry`, as a `SessionConfig` extension. Today the only way to attach it is `SessionConfig::with_extension`, which **replaces** the extension. If two libraries each register extension decoders, the second one silently discards the decoders of the first one. The failure shows only later, at decode time, as "No decoder is registered". We found this when we moved datafusion-distributed to the registry API. Distributed registers its plans in the worker `SessionConfig`, then gives the config to the user's session builder. A user who attaches their own registry there removes the distributed decoders. ```rust // Before: library B discards library A's decoders config = config.with_extension(Arc::new(registry_a)); config = config.with_extension(Arc::new(registry_b)); ``` ## What changes are included in this PR? A new generic method, `SessionConfig::update_extension`. It changes an extension in place, and creates it with `Default` if it is not there. If another config shares the extension, it is cloned first (`Arc::make_mut`), so that config does not change. ```rust // After: each library adds to the same registry, in any order config.update_extension(|registry: &mut ProtoDecoderRegistry| { register_execution_plan::<MyExec>(registry) })?; ``` The method is generic because `datafusion-execution` does not depend on `datafusion-proto-models`, where the registry is defined. It is useful for any extension that more than one part of an application writes to. The docs for `ProtoDecoderRegistry` and `register_execution_plan`, and the unreleased 56.0.0 upgrade guide, now recommend `update_extension` and say not to use `with_extension` for the registry. ## What is the testing strategy for this PR? - `proto::registry::tests::libraries_add_to_one_session_registry`: two "libraries" register different plans through `update_extension`. Both names stay registered. A config cloned between the two calls keeps only the first name. - A doc test on `update_extension`. ## Are there any user-facing changes? Yes, one new public method on `SessionConfig`. It is additive and does not break anything. No behavior changes for existing callers of `with_extension`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Which issue does this PR close? - Closes apache#26303. ## Rationale for this change lpad and rpad had four copies of the same per-row padding loop, plus two copies of the scalar fast path. The only real difference between them was whether the fill gets written before or after the string. ## What changes are included in this PR? - New `unicode/pad.rs` with a single kernel, generic over a `PadSide` trait (`LeftPad` / `RightPad`, same idea as `LeftRightSlicer` in `common.rs`). `lpad.rs` and `rpad.rs` are now thin wrappers with just the docs and tests. - The no-fill case goes through the same loop with `" "` as the fill, so the second loop is gone. - `parse_target_len` replaces the six copies of the `i32::MAX` / negative length check. Error text is unchanged. Two things came out of benchmarking: - Once the shared length check had its error branch inline, it stopped getting inlined into the hot loop and the no-fill path got noticeably slower. Moving the error into a `#[cold]` function fixed that. - The non-ASCII path now writes the fill in whole copies instead of one char at a time with a `%` per char. That's where the speedup below comes from. I also added `no fill` cases to the pad benchmarks (first commit). None of the existing cases covered a 2-arg call with a length column, which is the path this changes the most. ## What is the testing strategy for this PR? Existing lpad/rpad unit tests and sqllogictests pass unchanged. I added tests in `pad.rs` that pass array arguments to both functions, since most of the existing ones go through the scalar fast path: no fill, fill, nulls, zero length, truncation, string view input, a partial multi-char unicode fill (`rpad('josé', 6, 'ñéx')`), and the too-large length error. ## Benchmarks `cargo bench -p datafusion-functions --features unicode_expressions --bench unicode_expressions -- "pad size="`, main vs this branch, run back to back on the same machine: - non-ASCII string with a fill (8 cases): 31–48% faster - everything else (40 cases): somewhere between −16% and +14% in both directions, which is about the noise on my machine. The scalar cases, whose logic didn't change, moved by the same amount. Happy to re-run anything if someone wants different numbers. ## Are there any user-facing changes? No. --- Separately, I found that a negative length coming from a column panics on main (`pad_data_capacity` does `len as usize`). That's not part of this PR, and I'll open its own issue.
…pache#26419) ## Which issue does this PR close? This follows the same rationale as earlier pRs like - apache#10588 - apache#11831 - apache#18226 ## Rationale for this change Each `.rs` file directly in `datafusion/core/tests` becomes its own test binary. In this case, the standalone `set_comparison` binary requires **389 MB** on my machine (macOS, aarch64) to run just 6 small tests ```shell cargo test -p datafusion --test set_comparison --no-run ``` The binary was added in - apache#19109 ## What changes are included in this PR? Move `datafusion/core/tests/set_comparison.rs` to `datafusion/core/tests/sql/set_comparison.rs` and register it in `sql/mod.rs`, so it is built as part of `core_integration`. Size of `core_integration` (debug build): | | bytes | |---|---| | before | 457,079,488 | | after | 457,223,744 (+144 KB) | So this saves creating a ~389 MB binary at a cost of ~144 KB in `core_integration`. ## What is the testing strategy for this PR? CI ## Are there any user-facing changes? No, developer productivity / CI efficiency Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
…oupless aggregates (apache#25391) ## Which issue does this PR close? - Part of apache#24960. ## Rationale for this change See apache#24960. This is a split of apache#25008, which originally covered `EXISTS`/`NOT EXISTS`/`IN`/`NOT IN` together. That PR has been split into two smaller PRs between this one for `EXISTS`/`NOT EXISTS` and a (to come) follow-up stacked on top of it for `IN`/`NOT IN`. ## What changes are included in this PR? Correlated `EXISTS`/`NOT EXISTS` subqueries had count-bug compensation available but never turned it on. * Turn on count-bug compensation for correlated `EXISTS`/`NOT EXISTS` subqueries. * When compensation is needed, decorrelate into a `LEFT JOIN` and substitute the correct value instead of dropping the row. * Make unsupported join shapes fail loudly instead of silently falling back to incorrect behavior. `IN`/`NOT IN` compensation is out of scope for this PR and returns an explicit "not implemented" error. This will be covered by the follow-up PR. ## What is the testing strategy for this PR? Added twenty sqllogictest cases in `subquery.slt`. Ran all `datafusion`, `datafusion-cli`, and `datafusion-sqllogictest` suites, and `./dev/rust_lint.sh`. Also differentially fuzz-tested against DuckDB with a standalone harness, and did several adversarial review passes with Claude to look for gaps beyond the fuzzer's generated shapes. ## Are there any user-facing changes? None, except in the sense that this fixes a user-visible bug. ## AI Usage _AI was used during development of this PR, primarily to help review the test suite and verify test cases against the implemented fix._
## Which issue does this PR close? - N/A ## Rationale for this change Arrow 60 added `value_field()` to `GenericListArray`, `GenericListViewArray` and `FixedSizeListArray`. It returns the field that describes the list's elements. This PR adopts this new API more broadly, which enables removing some boilerplate and simplifying a few APIs. ## What changes are included in this PR? * Call `value_field` instead of matching on `data_type` directly * Update various APIs that passed both a typed list array along with a separate element field; the latter can be omitted ## What is the testing strategy for this PR? Existing tests pass. ## Are there any user-facing changes? No behavior changes.
…apache#26533) ## Which issue does this PR close? - Closes apache#26532. ## Rationale for this change `LAST_VALUE(expr) IGNORE NULLS` over a frame that starts at the first row of the partition, such as the default `RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW`, took time quadratic in the partition size. A 1M-row partition took 89 s, against 0.1 s with `RESPECT NULLS`. The issue has the reproducer. ## What changes are included in this PR? `NthValueEvaluator::valid_index` no longer slices the argument array for every row. It reads the frame's validity bits in place, since `BooleanBuffer::slice` is O(1), and for `LAST_VALUE` it finds the last valid row with a new `last_set_bit`. That function reads the bitmap a 64-bit word at a time from the end of the frame, so the cost per row is the distance back to the last non-NULL row instead of the size of the frame. `FIRST_VALUE` and `NTH_VALUE` keep their forward scans, but they also skip the per-row slice and null count. The results are unchanged: a frame without NULLs still resolves to its first, last or nth row. Two related costs are not changed here: - `memoize` still returns early for `LAST_VALUE` with `IGNORE NULLS`, so the frame start never moves and `BoundedWindowAggExec` keeps the whole partition buffered. That is apache#26539. - `NTH_VALUE(expr, -n) IGNORE NULLS` still counts the frame's valid rows for every row. That is apache#26538. ## What is the testing strategy for this PR? New `window.slt` cases cover `LAST_VALUE`, `FIRST_VALUE` and `NTH_VALUE` with `IGNORE NULLS` over partitions that span many 100-row batches. The partitions hold alternating NULLs, NULL runs across several bitmap words, only NULLs, or no NULLs. The cases use growing, sliding, whole-partition and peer-group frames. `v` increases within each partition, so every case is checked against `max` or `min` over the same frame, which computes the same value through the aggregate path. A unit test checks `last_set_bit` against a scan from the end for every bit offset up to 70 and every length up to 200. Both kinds of test fail if `last_set_bit` ignores the lead padding. `cargo bench -p datafusion-functions-window --bench nth_value`, `main` against this branch on an Apple M5 Max: | Benchmark | `main` | This PR | |---|---:|---:| | `last_value_expanding/30%_nulls` | 13.15 ms | 111 µs | | `last_value_expanding/50%_nulls` | 8.96 ms | 109 µs | | `last_value_expanding/80%_nulls` | 2.51 ms | 109 µs | | `last_value_sliding_100/50%_nulls` | 602 µs | 113 µs | | `first_value_expanding/50%_nulls` | 364 µs | 119 µs | | `nth_value_10_expanding/50%_nulls` | 379 µs | 137 µs | | `nth_value_neg10_expanding/50%_nulls` | 7.95 ms | 7.65 ms | | `first_value/respect_nulls` | 47.8 µs | 46.5 µs | The issue's query in `datafusion-cli` (`release-nonlto` profile), 1M rows: | Rows per partition | `main` | This PR | |---:|---:|---:| | 10,000 | 0.13 s | 0.03 s | | 100,000 | 1.90 s | 0.04 s | | 1,000,000 | 89.2 s | 0.16 s | ## Are there any user-facing changes? No, apart from the speed-up.
## Which issue does this PR close? - Related to apache#25088, apache#25148 ## Rationale for this change The `ubuntu-latest` ASF runner pool is perpetually overloaded. [ASF Infra recommends using the `ubuntu-slim` pool instead](https://infra.apache.org/services.html), when possible: > Use lightweight runners: For small, short jobs, consider using runs-on: ubuntu-slim. These provide 1 vCPU, 5GB RAM, no Docker engine, and a 15-minute hard limit. They churn much more quickly during peak times, allowing you to bypass the standard ubuntu-latest queue while freeing up capacity for others. This PR moves the following CI jobs to use `ubuntu-slim`: - `rust.yml`: Check cargo fmt, Check GitHub Actions install tooling, check Cargo.toml formatting, Verify Vendored Code - `dev.yml`: Check License Header, Check Markdown Links, Validate required_status_checks in .asf.yaml, Spell Check with Typos - `dependencies.yml`: Detect Unused Dependencies - `audit.yml`: security_audit - `docs_pr.yaml`: Test doc build - `breaking_changes_detector_comment.yml`: Comment on pull request `ubuntu-slim` doesn't have a Rust toolchain or a container runtime pre-installed, so we need to make some adjustments to allow for this migration: * Jobs that installed an `amd64/rust` container now do their work directly on the runner ("check cargo fmt", "verify vendored code", "check Cargo.toml formatting", and "detect unused dependencies"). There wasn't a particular reason to use a container for these jobs to begin with, and avoiding the container also reduces job runtimes and disk space consumption. * Jobs that need a Rust toolchain now have to install one themselves, so we add a new action to do that. We never used the preinstalled Rust toolchain on `ubuntu-latest` but we were able to use the preinstalled `rustup`, so the additional cost is just downloading `rustup`. * "Verify Vendored Code" needs `protoc`, so we install that via `install-action`. ## What changes are included in this PR? See above. ## What is the testing strategy for this PR? CI change only; checked locally with `actionlint`. ## Are there any user-facing changes? No.
…apache#26484) ## Which issue does this PR close? - Closes apache#26471. ## Rationale for this change `corr`, `covar_pop`, `covar_samp` and the `regr_*` functions return the same result with `DISTINCT` as without it, because their accumulators never read `is_distinct`. ## What changes are included in this PR? Their accumulators now return a not implemented error for `DISTINCT`, as `stddev` and `approx_median` already do. `corr(DISTINCT x, x)` still works, since `SingleDistinctToGroupBy` rewrites it before it reaches the accumulator. ## What is the testing strategy for this PR? New cases in `aggregate.slt`. The two `REGR_COUNT(DISTINCT ...)` results in `eliminate_join_distinct.slt` were the non-distinct counts, so they now expect the error. ## Are there any user-facing changes? These queries now fail with an error instead of returning a wrong result. --------- Co-authored-by: Alejandro Borrego <210245044+abp002@users.noreply.github.com>
…ache#26574) ## Which issue does this PR close? - Related to apache#25088, apache#25148 ## Rationale for this change apache#25591 moved several CI jobs to run on the submitter's fork. This PR moves an additional job, the circular dependency check. This further reduces the load on the ASF's shared runner pool, and reduces the typical wait time for CI results on PRs. ## What changes are included in this PR? See above. ## What is the testing strategy for this PR? CI change only. `actionlint` passes with no (additional) warnings. ## Are there any user-facing changes? No.
## Which issue does this PR close? - Related to apache#25088, apache#25148 ## Rationale for this change Many PRs modify some Rust code and also touch some SLT files. At present, this results in checking all of `datafusion-sqllogictest` for semver compatibility, which is very expensive (because it depends on almost all of the other crates). `datafusion-sqllogictest` is a published crate but it is test tooling that isn't part of the library API, so I think skipping semver checks for it is not unreasonable. The longer-term goal here is to make the semver check cheap enough that we can run it using `ubuntu-slim`, but we're probably not at that point yet. In any case, reducing semver check overhead is a useful improvement by itself. ## What changes are included in this PR? See above. We also use `install-action` to install `protoc` rather than `apt`, since it's much faster. ## What is the testing strategy for this PR? CI change only. ## Are there any user-facing changes? No.
…ache#26564) ## Which issue does this PR close? - Closes apache#26559. ## Rationale for this change `datafusion-ffi` is built as a `cdylib` only so that its own integration tests can `dlopen` it. Every downstream build pays for compiling and linking that unused shared library, and `sccache` can't cache crates with a `cdylib` crate type. ## What changes are included in this PR? - New unpublished crate `datafusion-ffi-integration-tests` in `datafusion/ffi/integration-tests/`, built as a `cdylib`, which re-exports the `#[no_mangle]` test entry points from `datafusion_ffi::tests`. Its `integration-tests` feature enables `datafusion-ffi/integration-tests`, so regular workspace builds still don't compile the test module. - `datafusion/ffi/tests/` moves there unchanged, and `find_library` looks for the new library name. - `datafusion-ffi` is now a plain `rlib`. - The `test ffi` xtask step and the `datafusion-ffi` agent skill include the new crate. The new crate needs both `cdylib` and `rlib`: with only `cdylib`, Cargo doesn't build the library before running the crate's integration tests. ## What is the testing strategy for this PR? Covered by the existing FFI integration tests, which now load the new crate's `cdylib`. ## Are there any user-facing changes? The public API and ABI of `datafusion-ffi` are unchanged. Crates that build their own `cdylib` on top of `datafusion-ffi` are unaffected. --- This PR was prepared with the help of a coding agent (Claude). Co-authored-by: Tim Saucer <timsaucer@gmail.com>
## Which issue does this PR close? - Part of #15914 - Related Comet issue: apache/datafusion-comet#5125 ## Rationale for this change Spark's `stack(n, expr1, ..., exprk)` separates the values into `n` rows. It is the standard way to unpivot in Spark SQL, and Comet falls back to Spark for it. ## What changes are included in this PR? - `stack` in `datafusion-spark`. A ScalarUDF cannot emit rows, so like `json_tuple` it returns the `n` rows as a `List<Struct<col0, col1, ...>>`, which is the data type of Spark's Generator. As in Spark, the list is not nullable while its elements and fields are. The caller (Comet, or `unnest` in SQL) expands it. - The arguments are validated as in Spark's `Stack.checkInputDataTypes`, with the same messages. `n` is coerced to `INT`. The values of a column must have the same Spark type, and NULLs, Arrow types of one Spark type (such as `Utf8` and `Utf8View`, or lists and maps whose field names differ) and integer literals that fit an `INT` column are cast to it. - Primitive columns are copied with a strided loop, and string columns of only scalars (such as unpivot keys) are tiled with a few large `concat` calls. Other types use `take` over the concatenated values. On the new `stack` bench this is about 3x to 5x faster than `interleave`. ## What is the testing strategy for this PR? `spark/generator/stack.slt` ports the cases of Spark's `GeneratorFunctionSuite`, `GeneratorExpressionSuite` and `TypeCoercionSuite`, and of the `generators`, `table-valued-functions` and `join-lateral` golden files. It also covers each kernel path. Unit tests cover an empty batch, the row limit and the type widening, which SQL cannot reach. ## Are there any user-facing changes? A new Spark-compatible `stack` function. Unlike Spark, `n` must be an integer literal, so a foldable expression such as `3 - 1` is rejected. The rows are materialized per batch, so a call that generates more than 16777216 rows (`n` times the batch size) fails with a resources error. Spark streams the rows and has no limit. With 8192-row batches this rejects `n` above 2048 for a column argument.
apache#26356) ## Which issue does this PR close? No issue filed. The reproduction is below. ## Rationale for this change `EliminateGroupByConstant` re-plans the original group expressions over the new `Aggregate` with `LogicalPlanBuilder::project`. Column normalization falls back to the input schema of the aggregate. Thus an unqualified group expression, such as an extracted leaf `__datafusion_extracted_1`, becomes `m.__datafusion_extracted_1` when the input is a `SubqueryAlias: m`. The new aggregate does not output that name, and the rule fails: ``` Optimizer rule 'eliminate_group_by_constant' failed caused by Schema error: No field named m.__datafusion_extracted_1. ``` The input plan is valid, and the rule turns it into an invalid one. We reach it when we optimize a plan, bind its parameters with `replace_params_with_values`, and optimize again. The bound value makes a group key redundant only after `ExtractLeafExpressions` has rewritten the plan. In a single `optimize` call, `EliminateGroupByConstant` runs before `ExtractLeafExpressions` in each pass, so I could not reproduce it there. Since apache#26184, the arguments of filtered aggregates no longer go into a common-expression projection between the aggregate and the alias, so the aggregate can sit directly on the alias and the problem shows. ```rust let ctx = SessionContext::new(); ctx.sql("CREATE TABLE t AS SELECT * FROM (VALUES (TIMESTAMP '2026-01-01T00:00:00', named_struct('a', 'x'), 1)) AS v(ts, s, x)") .await?.collect().await?; let scan = ctx.table("t").await?.into_unoptimized_plan(); let plan = LogicalPlanBuilder::from(scan) .alias("m")? .aggregate( vec![ date_bin( cast(placeholder("$1"), DataType::Interval(IntervalUnit::MonthDayNano)), col("ts"), lit(ScalarValue::TimestampNanosecond(Some(0), None)), ), get_field(col("s"), "a").alias("c"), col("ts"), ], vec![ sum(col("x") + lit(1)).filter(col("x").gt(lit(0))).build()?, max(col("x") + lit(1)).filter(col("x").lt(lit(5))).build()?, ], )? .build()?; let state = ctx.state(); let plan = state.optimize(&plan)?; let plan = plan.replace_params_with_values(&ParamValues::List(vec![ ScalarValue::Utf8(Some("1 minute".into())).into(), ]))?; state.optimize(&plan)?; // fails with the error above ``` ## What changes are included in this PR? - The rule builds the projection with `Projection::try_new` and does not re-plan the group expressions. A kept key or an aggregate becomes a column of the schema of the new aggregate. A redundant key keeps its expression, which reads only bare GROUP BY columns that the new aggregate outputs unchanged. An item gets an alias only when its name differs from the original output field, so existing plans do not change. ## What is the testing strategy for this PR? - New unit test `test_eliminate_with_unqualified_reference_to_qualified_input`. It fails without the change, with the same schema error. - `cargo test -p datafusion-optimizer` and `cargo test -p datafusion-sqllogictest --test sqllogictests` pass. No existing plan changes. ## Are there any user-facing changes? No API changes. A plan that failed in this rule now optimizes. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
apache#26550) ## Which issue does this PR close? - Closes apache#26549. ## Rationale for this change The `Security audit` CI job fails on `main` because of two new RustSec advisories. They affect certificate verification in the TLS stack used for HTTPS object store access: [RUSTSEC-2026-0382](https://rustsec.org/advisories/RUSTSEC-2026-0382) (`rustls-webpki`) and [RUSTSEC-2026-0383](https://rustsec.org/advisories/RUSTSEC-2026-0383) (`webpki-root-certs`). ## What changes are included in this PR? `Cargo.lock` only: - `rustls-webpki` 0.103.15 -> 0.103.16 - `webpki-root-certs` 1.0.9 -> 1.0.10 Both are patch releases within the existing semver ranges, so no `Cargo.toml` changes are needed. ## What is the testing strategy for this PR? `ci/scripts/security_audit.sh` passes with this change. It previously failed with 2 vulnerabilities. The existing CI covers the rest. ## Are there any user-facing changes? No. --- AI-assisted: I used an AI coding assistant while preparing this PR. I have reviewed and understand all changes. Co-authored-by: Neil Conway <neil.conway@gmail.com>
…pache#26453) ## Which issue does this PR close? - N/A ## Rationale for this change This PR optimizes `array_sort` on arrays of primitive values, where at least one element in the batch is NULL. Previously, `array_sort` started by counting the NULL elements in the row and then compacting the non-NULL elements to place NULLs either first or last (depending on the specified sort order). Doing the compaction already requires looking at every element's validity bit, so we can make this more efficient by doing the compaction first and deriving the null count as we go. When `NULLS FIRST`, we then need to move the non-NULL values after the NULLs. Empirically, the cost of the move is outweighed by the savings from avoiding a separate null count. The compaction loop avoids branching on each element's validity bit: when NULLs are scattered through a row, the CPU frequently mispredicts that branch. Instead, write every value to the next output slot and advance the write position only on valid values (which we can do without a branch!). Per suggestion by @mbutrovich. One consequence of the previous approach is that values in NULL slots were always the zeroed. We don't attempt to preserve that behavior, because Arrow allows NULL slots to contain arbitrary values. Two alternatives were considered: 1. Using `SetBitCounter` from apache#25754; this was faster on some inputs and slower on others. 2. Compacting values at the end of the buffer for `NULLS FIRST`, walking elements backwards but avoiding the post-compaction move; this was faster for small rows and slower for large rows. Along the way, improve the `array_sort` benchmarks: 1. Add coverage for `NULLS LAST` 2. Cycle through several input arrays and make the distribution of NULLs and array lengths more unpredictable, to avoid the branch predictor being able to memorize the benchmark input. ## Benchmarks x86, AMD EPYC-Milan: int32_null_elements/5 -24.3% int32_null_elements/20 -19.5% int32_null_elements/100 -13.1% int32_null_elements/1000 -8.9% int32_null_elements_desc/5 -24.3% int32_null_elements_desc/20 -19.1% int32_null_elements_desc/100 -13.6% int32_null_elements_desc/1000 -9.1% int32_null_elements_nulls_last/5 -28.4% int32_null_elements_nulls_last/20 -21.1% int32_null_elements_nulls_last/100 -14.6% int32_null_elements_nulls_last/1000 -9.4% ## What changes are included in this PR? See above. ## What is the testing strategy for this PR? Existing tests pass, new tests added. ## Are there any user-facing changes? No.
…apache#25482) ## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes apache#17874. ## Rationale for this change `DataFrame::select` currently does not support aggregate expressions directly. Users must explicitly call `DataFrame::aggregate`. This PR improves ergonomics by allowing aggregate expressions inside `select`, while preserving existing behavior and validation rules. <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. Please explain the problem you are trying to solve in terms of the user-visible behavior, rather than the implementation. For example, "The code in `foo.rs` doesn't handle nulls" is a symptom of the implementation. "COUNT(DISTINCT) returns wrong results when the column contains nulls" is the user-visible problem. --> ## What changes are included in this PR? - `DataFrame::select` lifts a global Aggregate when every expression is an aggregate or a scalar over aggregates (and literals). - Existing tests were not rewritten. - Examples are left for a follow-up. <!-- There is no need to duplicate the description in the issue here, but it is sometimes worth providing a summary of the individual changes in this PR. --> ## What is the testing strategy for this PR? - Existing `DataFrame` select/aggregate tests continue to pass without edits. - Added `test_dataframe_api_select_semantics` (from apache#21021, plus two cases for this design). - `roundtrip_expr_api` was not changed and still passes (mixed aggregate + scalar lists stay a `Projection`). <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code Briefly describe how this PR is tested, and point to the specific tests you added. For example: 'This new feature is covered by the `sqllogictest` cases added in `foo.slt`'. If this PR does not add tests, explain why. For example, if the change is already covered by existing tests, please mention it. You should also check the `codecov` bot reply on this PR to confirm the changed code is exercised. --> ## Are there any user-facing changes? Yes — additive behavior only. The public `select()` signature is unchanged. There are no breaking API changes. Users can write a global aggregation with `select()`: ```rust ctx.table("aggregate_test_100") .await? .select(vec![ approx_distinct(col("c9")).alias("count_c9"), approx_distinct(cast(col("c9"), DataType::Utf8View)) .alias("count_c9_str"), ])? .show() .await?; ``` Previously this required: ```rust ctx.table("aggregate_test_100") .await? .aggregate( vec![], vec![ approx_distinct(col("c9")).alias("count_c9"), approx_distinct(cast(col("c9"), DataType::Utf8View)) .alias("count_c9_str"), ], )? .show() .await?; ``` Both remain valid. Grouped aggregation is still aggregate(group, aggs). <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please add the `api change` label. --> --------- Co-authored-by: kosiew <kosiew@gmail.com>
…che#25861) ## Which issue does this PR close? Related to apache#25620. Split from apache#25648 following [the review request](apache#25648 (comment)). This PR can be reviewed and merged independently. ## Rationale for this change Joins repeat or drop input rows, and outer joins add NULL padding. Copying each input column's null count unchanged can therefore produce inconsistent output statistics. For example, a left join can repeat a NULL in a non-key left column many times, while an unmatched left row introduces NULLs in every right column. ## What changes are included in this PR? - Estimate inner and outer join null counts from the rows carrying each side's values and the rows added as NULL padding. - Estimate unmatched input rows using the existing semi-join estimator. Inner-join row counts count matching pairs, so they cannot alone determine how many input rows are unmatched. - Account for NULL keys under ordinary and null-safe equality, while retaining unknown contributions and conservative precision. - Rescale null counts when a statistics provider replaces the row estimate. Cover projected joins and swapped inputs. The semi/anti-join estimator itself is unchanged. The rules follow join semantics and do not contain benchmark-specific cases. ## What is the testing strategy for this PR? Added unit tests cover NULL padding, repeated matches, unknown counts, null-safe keys, projection, input swapping, and provider rescaling. Existing cardinality assertions remain in place. Passed on this independent branch: - `cargo test --profile ci -p datafusion-physical-plan --lib` (2,369 tests) - `cargo clippy --profile ci -p datafusion-physical-plan --all-targets --all-features -- -D warnings` - `cargo fmt --all` and `git diff --check` Benchmarks were not rerun for the split. This extracts the join implementation already present in apache#25648; its earlier combined measurements are not isolated measurements of this PR. ## Are there any user-facing changes? Join row and null-count estimates can change, which can affect EXPLAIN output and plan choices. No public API changes.
…versed (apache#26440) ## Which issue does this PR close? - Closes apache#26439. ## Rationale for this change `array_agg(DISTINCT x ORDER BY x)` returns its values in the wrong order when an earlier aggregate in the same query orders by `x` in the other direction: ```sql SELECT array_agg(x ORDER BY x DESC), array_agg(DISTINCT x ORDER BY x) FROM (VALUES (2), (NULL), (1), (2)) t(x); -- before: [NULL, 2, 2, 1] [NULL, 2, 1] -- after: [NULL, 2, 2, 1] [1, 2, NULL] ``` `string_agg(DISTINCT x, ',' ORDER BY x)` has the same problem, since it uses the same accumulator. When the aggregates need opposite orderings, the planner swaps one of them for its reverse expression, which flips the `ORDER BY` and sets `is_reversed`. The ordered (non-`DISTINCT`) `array_agg` accumulator undoes that at the end, but the `DISTINCT` accumulator sorts its values itself using the flipped sort options and never looks at `is_reversed`. ## What changes are included in this PR? In `ArrayAgg::accumulator`, the `DISTINCT` branch flips the sort options back when `is_reversed` is set, so `DistinctArrayAggAccumulator` sorts in the order the user asked for. ## What is the testing strategy for this PR? New sqllogictest cases: - `array_agg.slt`: the query above (including a NULL, so NULL placement is checked too) and a `GROUP BY` variant. - `aggregate.slt`: `string_agg(DISTINCT ... ORDER BY ...)` next to a `string_agg(... ORDER BY ... DESC)`. All three fail on `main` and pass with this change. The rest of the sqllogictest suite and the `datafusion-functions-aggregate` unit tests pass. ## Are there any user-facing changes? Queries like the one above now return the documented order. No API changes. ## Other notes apache#26357 adds a `GroupsAccumulator` for `array_agg(DISTINCT)`. If it sorts with the expression's sort options, the same `is_reversed` handling is probably needed there too. Co-authored-by: JanakiRamChittineni <341781521+raams95@users.noreply.github.com> Co-authored-by: Qi Zhu <zhuqilucas@gmail.com>
## Which issue does this PR close? Closes apache#24868. ## Rationale for this change Microbenchmarks can compile successfully but panic when executed. Running their cases in CI catches stale benchmark fixtures and invocation assumptions without collecting performance measurements. ## What changes are included in this PR? - Add `cargo xtask ci step test microbenchmarks` and a required extended CI job. Following the existing workflow convention, it runs in the merge queue, on release-branch pushes, and manually; it skips PR events. - Execute Criterion bench targets in test mode with `--no-fail-fast`, including the physical-plan benchmarks gated by `test_utils`. The `ci-bench` profile retains workspace debug assertions and overflow checks with light optimization to keep larger cases practical. - Use the checked-in ten-row ClickBench fixture for SQL planner smoke tests through `CLICKBENCH_DATA_PATH`. Ordinary performance runs retain their full-dataset default. The separate SQL benchmark harness, which requires generated datasets, remains covered by its existing jobs. - Fix benchmark failures exposed by execution: timestamp timezone metadata, Spark slice input coercion, string return types, and repeat row counts/error assertions. Slice coercion happens before timing the UDF. - Clarify the Spark ListView benchmark labels and check the repeat overflow diagnostic outside the timed loop. Patch two certificate dependencies to resolve the security audit failure. ## What is the testing strategy for this PR? - The full `cargo xtask ci step test microbenchmarks` run passed all 131 benchmark targets on upstream `99193cbd0`. After rebasing onto `6c1727fcd`, the Spark slice and repeat benchmark smoke tests passed again, including the new labels and overflow diagnostic assertion. - `cargo fmt --all` and `cargo clippy --all-targets --all-features -- -D warnings` pass with the pinned Rust 1.99 toolchain on the final rebase. - `./ci/scripts/security_audit.sh` passes after patching `rustls-webpki` to 0.103.16 and `webpki-root-certs` to 1.0.10. - Extended workspace tests were run with the documented features. The run stopped at the existing `sort_with_mem_limit_1_runner` RSS assertion: the core integration target had 1,463 passing tests, one failure, and one ignored test. Its RSS monitor reported a zero-byte baseline and a 192.2 MB peak against a 190.7 MB limit. The unchanged test passed in isolation on a clean upstream build, but the full run still fails locally. No tests were skipped and no memory-test code or limits were changed. ## Are there any user-facing changes? No query behavior or public API changes. Benchmark contributors gain a local smoke-test command and automated execution coverage.
) ## Which issue does this PR close? - Closes apache#10628. ## Rationale for this change Users need concrete examples of inspecting and rewriting `LogicalPlan` trees with the `TreeNode` APIs, including subqueries embedded in expressions. ## What changes are included in this PR? - Extend the `LogicalPlan` rustdoc example to collect table names with `TreeNode::apply`. - Add a tested `TreeNode::rewrite` example that removes Filter nodes, explaining traversal order and the change in query semantics. - Add the `query_planning -- plan_walk` example demonstrating plan inspection, stateful rewriting, subquery traversal, and collecting predicates from both Filter nodes and TableScan filters. - Register the example in the query planning runner and update the generated examples README. ## What is the testing strategy for this PR? The rustdoc examples and assertions in the executable example verify the collected table names, rewritten plan, subquery traversal, and filter predicates. - `cargo test --profile ci -p datafusion-expr --doc logical_plan::plan::LogicalPlan` (8 passed) - `cargo run --profile ci -p datafusion-examples --example query_planning -- plan_walk` - `cargo fmt --all` - `cargo clippy --all-targets --all-features -- -D warnings` - `./ci/scripts/doc_prettier_check.sh --write --allow-dirty` - `./dev/rust_lint.sh` (run via `uv run --package datafusion-dev --with PyYAML`) ## Are there any user-facing changes? The API documentation now includes additional plan walking and rewriting examples and links to an executable walkthrough. There are no changes to query execution or public APIs. --------- Co-authored-by: kosiew <kosiew@gmail.com>
…e#25469) ## Which issue does this PR close? Closes apache#25463 ## Rationale for this change Multi-column joins can produce filters such as: ```sql (a, b) IN ((1, 10), (2, 20)) ``` DataFusion can evaluate this filter on individual rows, but it does not extract the allowed values for each column. This prevents bloom filters from using those values to skip row groups. ## What changes are included in this PR? - Extract per-column values: `a IN (1, 2)` and `b IN (10, 20)`. - Keep the original tuple filter, so combinations such as `(1, 20)` are still rejected. This will only enable bloom filter pruning for row groups. ## What is the testing strategy for this PR? Added some tests for the new behaviour ## Are there any user-facing changes? Queries with supported tuple IN filters, including dynamic filters from multi-column joins, may read fewer row groups when Bloom filters are available
…amic filter (backport apache#27142) (apache#27174) ## Which issue does this PR close? - part of apache#24461 - Backport of apache#27142 to `branch-56` - Fixes the 56 regression reported in apache#27130. ## What changes are included in this PR? Clean cherry-pick of apache#27142: copies made by `SortExec::reset_state()` each get their own TopK dynamic filter again (reverting apache#26670), and the old filter is reset so a plan that is run, reset and run again doesn't keep the previous bound in the scan. ## Are these changes tested? Same tests as apache#27142. On `branch-56`: `datafusion-physical-plan` sort tests 164/164, sqllogictest 544/544, clippy and fmt clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
…value key count (backport apache#27111) (apache#27176) ## Which issue does this PR close? - Backport of apache#27111 to `branch-56` - Part of apache#24461 - Closes apache#26569 Co-authored-by: Liang-Chi Hsieh <viirya@gmail.com> Co-authored-by: Isaac <no-reply@databricks.com>
…pache#27139) (apache#27178) ## Which issue does this PR close? - Backport of apache#27139 to `branch-56` - Part of apache#24461 - Closes apache#27023 Co-authored-by: Kumar Ujjawal <ujjawalpathak6@gmail.com>
…jection (backport apache#27123) (apache#27179) ## Which issue does this PR close? - Backport of apache#27123 to `branch-56` - Part of apache#24461 - Closes apache#26624 Co-authored-by: Kumar Ujjawal <ujjawalpathak6@gmail.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
…address (backport apache#27097) (apache#27175) ## Which issue does this PR close? - Backport of apache#27097 to `branch-56` - Part of apache#24461 - Closes apache#27069 Co-authored-by: Andy Grove <agrove@apache.org>
…#27098) ## Which issue does this PR close? - Part of apache#24461 ## Rationale for this change Prepare `branch-56` for the `56.0.0` release. ## What changes are included in this PR? This PR contains: 1. Version number update from `56.0.0-dev` to `56.0.0` 2. The generated changelog for `56.0.0` 3. A small fix to `dev/release/generate-changelog.py`: it crashed with `AttributeError: 'NoneType' object has no attribute 'login'` because one commit in the range has no GitHub user linked to its author email. The script now falls back to the PR author in that case. See rendered changelog: https://github.com/alamb/datafusion/blob/alamb/prepare_56/dev/changelog/56.0.0.md ## What is the testing strategy for this PR? N/A (version and changelog only) ## Are there any user-facing changes? New release version --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
…) (apache#27204) ## Which issue does this PR close? - part of apache#24461 - Backport of apache#25186 to `branch-56` - Related to apache#27121. Co-authored-by: Geoffrey Claude <geoffrey.claude@gmail.com>
…) (apache#27331) ## Which issue does this PR close? - Backport of apache#27060 to `branch-56`. - Fixes apache#26162 on the 56 release line. - Part of apache#24461. ## Rationale for this change A finer ordering pushed below `SortPreservingMergeExec` is lost when the merge keeps fewer keys. This produces incorrectly ordered results and can make a window query fail plan validation. Downstream testing still reproduces the failure in the 56 line. The original fix merged after `branch-56` was cut and is needed before the DataFusion 56 release candidate. ## What changes are included in this PR? Cherry-pick `3f4a37fbabdcb07705db6341268e6c0b34da0d34` from apache#27060. Keep the finer parent sort above the merge, together with the original regression tests. The `limit.slt` conflict was append context from an unrelated test absent on `branch-56`; only the original apache#26162 regression block is added. ## What is the testing strategy for this PR? Carries the original `limit.slt` checks for ordered output, a window, an ordered aggregate and a UNION, plus the physical-plan regression for a merge without a fetch. `cargo fmt --all`, both targeted physical-plan tests and the `limit.slt` checks passed. Reverting the optimizer change makes the new non-fetched-merge regression fail. ## Are there any user-facing changes? Queries retain their requested ordering above sort-preserving merges. No public API changes. This PR was prepared with AI assistance. Co-authored-by: Sanghoon <75651582+galaxytemple@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## branch-55 #211 +/- ##
============================================
Coverage ? 83.30%
============================================
Files ? 1170
Lines ? 476209
Branches ? 476209
============================================
Hits ? 396697
Misses ? 55483
Partials ? 24029
🚀 New features to boost your workflow:
|
…er_factory setter on ListingTable (backport apache#27317) (apache#27369) ## Which issue does this PR close? - part of apache#24461 - Backport of apache#27317 to `branch-56` - Related to apache#27314. Co-authored-by: Sruhvx <dronsruhvx26@proton.me>
…t leads an ordering (backport apache#27191) (apache#27368) ## Which issue does this PR close? - part of apache#24461 - Backport of apache#27191 to `branch-56` - Related to apache#26762. Co-authored-by: Jay Zhan <jayzhan211@gmail.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
## Which issue does this PR close? - Part of apache#24461 ## Rationale for this change Several PRs were backported to `branch-56` after the changelog was generated in apache#27098, so they are missing from `dev/changelog/56.0.0.md`. ## What changes are included in this PR? Regenerates the changelog with `dev/release/generate-changelog.py 55.0.0 branch-56 56.0.0`. This adds entries for: - apache#27243 - apache#27204 - apache#27331 - apache#27369 - apache#27368 - apache#27098 and updates the commit count and credits. ## What is the testing strategy for this PR? N/A (changelog only) ## Are there any user-facing changes? No Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…t (backport apache#27407) (apache#27542) ## Which issue does this PR close? Backports apache#27407 to `branch-56` for the 56.0.0 release tracked in apache#24461. The same fix was already backported to `branch-55` (apache#27408) and `branch-54` (apache#27409). Related to apache#27431 and apache#27388. ## Rationale for this change `cargo audit` fails on `branch-56` with 3 vulnerabilities in the locked `quinn-proto` and `quinn-udp` versions: - `quinn-proto` 0.11.18: [RUSTSEC-2026-0523](https://rustsec.org/advisories/RUSTSEC-2026-0523), [RUSTSEC-2026-0524](https://rustsec.org/advisories/RUSTSEC-2026-0524) - `quinn-udp` 0.5.14: [RUSTSEC-2026-0538](https://rustsec.org/advisories/RUSTSEC-2026-0538) These versions are in the 56.0.0 RC1 lockfile. They also fail the `security_audit` check on apache#27541. RC2 is being cut anyway, so this backport keeps the vulnerable versions out of the released lockfile. ## What changes are included in this PR? Clean cherry-pick of 73e0b03. Only `Cargo.lock` changes: | Crate | Before | After | | ------------- | ------- | ------- | | `quinn-proto` | 0.11.18 | 0.11.19 | | `quinn-udp` | 0.5.14 | 0.5.16 | ## What is the testing strategy for this PR? Covered by the `security_audit` CI job. Locally, `cargo audit` (0.22.2) reports the 3 vulnerabilities above on the current `branch-56` lockfile. After this change it exits with 0 vulnerabilities, leaving only the allowed warnings. ## Are there any user-facing changes? No. These are semver-compatible dependency updates in `Cargo.lock` only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…ackport apache#27428) (apache#27541) ## Which issue does this PR close? Backports apache#27428 (fix for apache#27427) to `branch-56` for the 56.0.0 release tracked in apache#24461. ## Rationale for this change The datafusion-python upgrade exposed a planning regression in 56.0.0 RC1. When the query planner and optimizer run on opposite sides of the FFI boundary, the optimizer can miss an aggregate's hash partitioning requirement and produce a plan that fails `SanityCheckPlan`. This blocks apache/datafusion-python#1826. ## What changes are included in this PR? Clean cherry-pick of 701e556. Foreign execution plans expose their input requirements, and physical expressions originating in the same library can be compared for equality. The 56.0.0 upgrade guide describes both ABI changes. ## What is the testing strategy for this PR? Verified on the backport branch: - `cargo clippy --all-targets --all-features -- -D warnings` - `cargo test -p datafusion-ffi -p datafusion-ffi-integration-tests --features integration-tests`, including the `EnsureRequirements` regression and the cross-library plan-requirements and expression-equality tests - `cargo fmt --all` and the repository's Markdown formatting check Local `cargo audit` reports RUSTSEC-2026-0523, RUSTSEC-2026-0524 and RUSTSEC-2026-0538 for the existing `quinn-proto` and `quinn-udp` versions. The unmodified RC1 lockfile reproduces all three findings. This backport preserves the dependency versions. ## Are there any user-facing changes? Yes. Foreign plans preserve their input requirements. The layouts of `FFI_ExecutionPlan` and `FFI_PhysicalExpr` change. FFI providers and consumers built against RC1 must be rebuilt together for RC2. Including the fix before 56.0.0 is final keeps one ABI for the published 56.x series. Co-authored-by: Andy Grove <agrove@apache.org>
## Which issue does this PR close? - Part of apache#24461 ## Rationale for this change apache#27541 and apache#27542 were backported to `branch-56` for RC2 after the changelog was regenerated in apache#27382, so they are missing from `dev/changelog/56.0.0.md`. ## What changes are included in this PR? Regenerates the changelog with `dev/release/generate-changelog.py 55.0.0 69d40d1 56.0.0`, where 69d40d1 is the current `branch-56` head, then formats it with `prettier`. This adds entries for: - apache#27541 (listed under breaking changes because of its `api change` label: the `FFI_ExecutionPlan` and `FFI_PhysicalExpr` layouts change) - apache#27542 - apache#27382 It also updates the commit count (1206 → 1209) and the credits. The author shown for apache#25337 changes from `dd-annarose` to `anna-lscr`. The script reads the current GitHub login for the commit author, so this reflects a renamed account. ## What is the testing strategy for this PR? N/A (changelog only). `ci/scripts/doc_prettier_check.sh` passes. ## Are there any user-facing changes? No 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
Create the Datadog release branch for DataFusion 56, following the same review shape as #167 for DataFusion 55.
What changes are included in this PR?
branch-56mirrorsapache/datafusion:branch-56at3f197fe0bc6365756bb88ef2e51c01631da913ca.Are these changes tested?
The fork pre-push hook passed:
cargo fmt, workspacecargo clippy, andtypos. The pushed ref was verified against the Apache branch SHA.Are there any user-facing changes?
No. This PR is the reviewable diff between the Datadog DataFusion 55 and 56 release branches.