Skip to content

fix: preserve native sliding integer sum overflow semantics - #43

Draft
rich7420 wants to merge 5 commits into
ci-base/6069-native-mainfrom
ci/6069-native-sliding
Draft

rich7420 wants to merge 5 commits into
ci-base/6069-native-mainfrom
ci/6069-native-sliding

Conversation

@rich7420

@rich7420 rich7420 commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Which issue does this PR close?

Related to apache#6043 and apache#6069. Fork CI verification only; this PR does not close an upstream issue.

Rationale for this change

Sliding ANSI/TRY integer SUM needs Spark-compatible overflow detection and recovery while keeping native window execution. This fork draft preserves the verified ce6e3a90d snapshot with Spark SQL and benchmark CI coverage. Upstream apache#6069 has since advanced to 67889aba5; this older fork no longer matches its current head.

What changes are included in this PR?

The head is ce6e3a90dc0d2333f8cf0c6a8c8b60c53e96b054, the earlier upstream apache#6069 snapshot. The pinned comparison base is main c7aa38bd0b1e7dde39cf650da43a4452a7a5ea4c.

The six-file feature diff contains the native sliding integer accumulator, planner routing, window regression tests, SQL fixtures, benchmark and expression audit. It preserves intermediate overflow and TRY recovery with exact i128 prefix sums and monotonic prefix extrema; update/retract is amortized O(1) per non-null value, and retained capacity is accounted. Legacy integer SUM and ordinary aggregate paths are unchanged. These implementation/test/benchmark changes match the previously verified fork candidate 3e8625af81c6233a4e4b79b82612087ed8b03566; the new head additionally integrates the pinned main.

How are these changes tested?

At 3e8625af8, the release native build, 70 Spark 4.1 window tests, four Spark 3.5 strict-warning regressions, ten Rust SUM tests, workspace/all-target release Clippy, formatting and license checks passed locally. The regression includes exhaustive five-value sequences across four frame widths and three evaluation modes. The twelve-case local benchmark (65,536 rows; widths 16/1,024; 0/50/100% NULL; SUM/TRY_SUM) measured native execution 1.29–31.94x faster than Spark within that matrix.

The complete earlier fork run passed, including all nine Spark 4.1 SQL shards. A later run at that old head was cancelled and has a red aggregate verdict; it does not establish a code failure or a current complete verdict.

Completed snapshot CI passed at ce6e3a90d: Required Checks, all Comet suites, Rust, strict Spark 3.5/JDK17 compilation, benchmark checks, TPC-H/TPC-DS and all nine Spark 4.1 SQL shards. Other Spark runtime profiles, Iceberg and macOS were skipped. This remains valid evidence for that snapshot, not for the newer main merge.

Upstream apache#6069 now has successful CI at 67889aba5. Fork #30 tracks that current head for additional CI. The cancelled execution job in upstream run 36725911344 belonged to ce6e3a90d; its old maintainer-rerun request is superseded by the new head's successful upstream run.

@rich7420 rich7420 added run-spark-4.1-tests Run Spark 4.1 SQL tests across all modules run-benchmark-check labels Sep 30, 2026
@github-actions github-actions Bot added bug Something isn't working area:aggregation labels Sep 30, 2026
@rich7420
rich7420 changed the base branch from main to ci-base/6069-native-main September 30, 2026 11:01
@kazuyukitanimura

Copy link
Copy Markdown

Hi @rich7420
Is this ready for review?

@rich7420

rich7420 commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner Author

@kazuyukitanimura Yes, the current version is ready for review at apache/datafusion-comet#6069. This fork PR preserves an older CI snapshot iits changes are included there

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

Labels

area:aggregation bug Something isn't working run-benchmark-check run-spark-4.1-tests Run Spark 4.1 SQL tests across all modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants