[AURON #1888] Implement spark_partition_id() function#1928
Merged
richox merged 2 commits intoapache:masterfrom Jan 21, 2026
Merged
[AURON #1888] Implement spark_partition_id() function#1928richox merged 2 commits intoapache:masterfrom
richox merged 2 commits intoapache:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements support for the spark_partition_id() function using native execution, enabling Auron to handle this non-deterministic expression natively rather than falling back to Spark's implementation.
Changes:
- Added Rust implementation of SparkPartitionIdExpr that returns the partition ID as a constant Int32 array
- Integrated the expression into the planner, protobuf schema, and Scala conversion layers
- Included comprehensive unit tests for the Rust implementation
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| native-engine/datafusion-ext-exprs/src/spark_partition_id.rs | New Rust implementation of SparkPartitionIdExpr with unit tests |
| native-engine/datafusion-ext-exprs/src/lib.rs | Registers the new spark_partition_id module |
| native-engine/auron-planner/src/planner.rs | Integrates SparkPartitionIdExpr into the planner, passing partition_id from PhysicalPlanner |
| native-engine/auron-planner/proto/auron.proto | Adds SparkPartitionIdExprNode protobuf message definition |
| spark-extension/src/main/scala/org/apache/spark/sql/auron/NativeConverters.scala | Adds conversion for StubExpr("SparkPartitionID") to protobuf |
| spark-extension-shims-spark/src/main/scala/org/apache/spark/sql/auron/ShimsImpl.scala | Adds conversion for SparkPartitionID expression to protobuf and imports the catalyst expression |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
richox
approved these changes
Jan 21, 2026
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 ##1888
Rationale for this change
This is part of the effort to add non-deterministic expressions to Auron.
What changes are included in this PR?
This PR adds support for spark_partition_id using native
Are there any user-facing changes?
N/A
How was this patch tested?
Unit tests