[AURON #2152] Implement native function of map_from_arrays#2165
Merged
slfan1989 merged 2 commits intoapache:masterfrom Apr 8, 2026
Merged
[AURON #2152] Implement native function of map_from_arrays#2165slfan1989 merged 2 commits intoapache:masterfrom
slfan1989 merged 2 commits intoapache:masterfrom
Conversation
Signed-off-by: weimingdiit <weimingdiit@gmail.com>
25 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Adds native execution support for Spark’s map_from_arrays(keys, values) via Auron’s extension-function path, aligning behavior with Spark semantics (null propagation + null-key rejection) and adding regression coverage.
Changes:
- Adds Spark plan conversion for
MapFromArraysto the native extension-function call (Spark_MapFromArrays). - Registers and implements the
Spark_MapFromArraysextension function in the native engine (Arrow/DataFusion). - Adds Scala + Rust tests covering baseline behavior and null-key rejection.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| spark-extension/src/main/scala/org/apache/spark/sql/auron/NativeConverters.scala | Converts Spark MapFromArrays expression into the Spark_MapFromArrays native extension function call. |
| spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala | Adds Spark-side regression tests for map_from_arrays, including a null-key rejection case. |
| native-engine/datafusion-ext-functions/src/spark_map.rs | Implements map_from_arrays in Rust, including Spark-like null propagation and null-key/duplicate-key errors, plus Rust unit tests. |
| native-engine/datafusion-ext-functions/src/lib.rs | Registers Spark_MapFromArrays for extension-function dispatch. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronFunctionSuite.scala
Show resolved
Hide resolved
…ull handling Signed-off-by: weimingdiit <weimingdiit@gmail.com>
slfan1989
approved these changes
Apr 8, 2026
Contributor
Author
|
@slfan1989 Thanks for your review and merge! |
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 #2152
Rationale for this change
This PR adds native support for Spark
map_from_arrays(keys, values)through Auron’s extension-function path.Spark defines this function as creating a map from the given key/value arrays, with the requirement that all elements in
keysmust be non-null. This change implements that behavior in Auron and adds regression coverage.map_from_arrays(...)was not supported in Auron’s native execution path.This PR extends native map-function coverage while keeping behavior aligned with Spark semantics, following the existing extension-function pattern already used for Spark-specific functions such as
map_concat(...).What changes are included in this PR?
This PR:
MapFromArraysconversion inNativeConvertersSpark_MapFromArraysindatafusion-ext-functionsmap_from_arrays(...)inspark_map.rsAre there any user-facing changes?
Yes.
Queries using
map_from_arrays(keys, values)can now run through Auron’s native extension-function path.How was this patch tested?
UT.