[AURON #1889] Implement monotonically_increasing_id() function #1955
Merged
richox merged 4 commits intoapache:masterfrom Feb 3, 2026
Merged
[AURON #1889] Implement monotonically_increasing_id() function #1955richox merged 4 commits intoapache:masterfrom
richox merged 4 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Implements native support for Spark’s monotonically_increasing_id() as a non-deterministic physical expression in Auron, wiring it through the Spark shims, protobuf plan representation, and the Rust planner and execution engine.
Changes:
- Adds a
MonotonicallyIncreasingIdExprNodeto the protobufPhysicalExprNodeoneof and wires it through the ScalaShimsImpl.convertMoreExprWithFallback. - Introduces
SparkMonotonicallyIncreasingIdExprindatafusion-ext-exprs, including unit tests that validate type, nullability, monotonicity, partition offsets, and partition separation. - Extends the Rust
PhysicalPlannerto buildSparkMonotonicallyIncreasingIdExprfrom the new protobuf expression type and exposes the module fromdatafusion-ext-exprs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spark-extension-shims-spark/src/main/scala/org/apache/spark/sql/auron/ShimsImpl.scala | Maps Spark’s MonotonicallyIncreasingID Catalyst expression to the new protobuf MonotonicIncreasingIdExprNode for native planning. |
| native-engine/datafusion-ext-exprs/src/spark_monotonically_increasing_id.rs | Implements the physical expression that generates 64-bit partition-scoped monotonically increasing IDs and adds unit tests for behavior. |
| native-engine/datafusion-ext-exprs/src/lib.rs | Exposes the new spark_monotonically_increasing_id module from the extension expressions crate. |
| native-engine/auron-planner/src/planner.rs | Deserializes the new protobuf MonotonicIncreasingIdExpr into SparkMonotonicallyIncreasingIdExpr during physical planning. |
| native-engine/auron-planner/proto/auron.proto | Extends the physical expression protobuf with MonotonicIncreasingIdExprNode and its field in PhysicalExprNode, and relocates SparkPartitionIdExprNode to avoid duplication. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
native-engine/datafusion-ext-exprs/src/spark_monotonically_increasing_id.rs
Show resolved
Hide resolved
Contributor
Author
|
@cxzl25 can I get a re-review on this? Thanks! |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
richox
approved these changes
Jan 29, 2026
Contributor
Author
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?
Closes #1889
Rationale for this change
Adds's support for non-deterministic function, as part of #1833
What changes are included in this PR?
Implements native support for Spark's `monotonically_increasing_id()`` function in Auron.
Functionality TL;DR:
The
monotonically_increasing_id()function generates unique, monotonically increasing 64-bit integers across all partitions. Each partition generates IDs using the formula:Are there any user-facing changes?
N/A
How was this patch tested?
Unit tests