Skip to content

[AURON #1712] Fix Casting from Map to Utf8 not supported#1744

Merged
richox merged 1 commit intoapache:masterfrom
cxzl25:auron_1712
Dec 17, 2025
Merged

[AURON #1712] Fix Casting from Map to Utf8 not supported#1744
richox merged 1 commit intoapache:masterfrom
cxzl25:auron_1712

Conversation

@cxzl25
Copy link
Contributor

@cxzl25 cxzl25 commented Dec 12, 2025

Which issue does this PR close?

Closes #1712

Rationale for this change

Arrow error: Cast error: Casting from Map to Utf8 not supported

What changes are included in this PR?

Are there any user-facing changes?

How was this patch tested?

Add UT

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements support for casting Map types to Utf8 (String) in the Auron query engine, addressing issue #1712. The implementation follows Spark-compatible formatting, where maps are rendered as {key1 -> value1, key2 -> value2}, and properly handles nested types and null values.

Key Changes:

  • Added map-to-string casting logic in the Rust cast implementation that recursively converts keys and values to strings
  • Added comprehensive unit tests in both Rust (4 tests) and Scala (4 tests) covering basic maps, null maps, empty maps, and nested/complex maps
  • The implementation mirrors the existing struct-to-string casting pattern for consistency

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
native-engine/datafusion-ext-commons/src/arrow/cast.rs Adds map-to-string casting implementation (lines 222-267) with Spark-compatible formatting and 4 comprehensive unit tests covering various map scenarios
spark-extension-shims-spark/src/test/scala/org.apache.auron/AuronQuerySuite.scala Adds 4 integration tests for map-to-string casting, properly gated for Spark 3.1+, covering simple maps, nested maps, maps with struct values, and empty maps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@richox richox merged commit 64c3e0e into apache:master Dec 17, 2025
104 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Arrow error: Cast error: Casting from Map to Utf8 not supported

3 participants