Skip to content

fix: support map casts with NullType elements - #5045

Merged
sunchao merged 4 commits into
apache:mainfrom
peterxcli:fix/map-cast-null
Aug 23, 2026
Merged

fix: support map casts with NullType elements#5045
sunchao merged 4 commits into
apache:mainfrom
peterxcli:fix/map-cast-null

Conversation

@peterxcli

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #3389.

Rationale for this change

The native cast path supports NullArray casts, but the planner rejected NullType map elements before they reached it.

What changes are included in this PR?

  • Treat NullType casts as compatible with native execution.
  • Require native coverage for numeric-key and empty-map map_contains_key cases.

How are these changes tested?

  • make core
  • ./mvnw test -Pjdk17 -Dtest=none -Dsuites='org.apache.comet.CometSqlFileTestSuite map_contains_key.sql'

@peterxcli
peterxcli marked this pull request as ready for review July 27, 2026 06:02
@peterxcli

Copy link
Copy Markdown
Member Author

cc @comphead PTAL. Thanks!

@sunchao sunchao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the NullType compatibility change against Spark's cast rules and Comet's recursive native map cast path. I found no P1/P2 issues. The native NullType conversion produces correctly typed null arrays, and the SQL test changes require native execution for the supported map casts.

Exact-head CI passed. I did not run the full test matrix locally.

@sunchao
sunchao merged commit cbc0e07 into apache:main Aug 23, 2026
71 checks passed
@sunchao

sunchao commented Aug 23, 2026

Copy link
Copy Markdown
Member

Merged, thanks @peterxcli !

@peterxcli
peterxcli deleted the fix/map-cast-null branch August 23, 2026 04:46
@peterxcli

Copy link
Copy Markdown
Member Author

Thanks @sunchao !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support map type casting for numeric type and null type element

2 participants