Skip to content

GH-50231: Handle unset Substrait extension mapping type#50263

Open
Reranko05 wants to merge 1 commit into
apache:mainfrom
Reranko05:gh-50231-substrait-unreachable
Open

GH-50231: Handle unset Substrait extension mapping type#50263
Reranko05 wants to merge 1 commit into
apache:mainfrom
Reranko05:gh-50231-substrait-unreachable

Conversation

@Reranko05

@Reranko05 Reranko05 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

A malformed Substrait SimpleExtensionDeclaration with an unset mapping_type currently reaches Unreachable(), causing the process to abort during deserialization. Since this can be triggered by malformed input, the deserializer should instead return an Invalid status.

What changes are included in this PR?

  • Replace the Unreachable() call in GetExtensionSetFromMessage with a Status::Invalid return for unset or unknown mapping_type values.
  • Add a regression test to verify that deserializing a Substrait plan containing an empty SimpleExtensionDeclaration returns an Invalid status instead of aborting.

Are these changes tested?

Yes. A regression test covering the malformed SimpleExtensionDeclaration case has been added to serde_test.cc.

Are there any user-facing changes?

No.

This PR contains a "Critical Fix".

This change prevents process termination when deserializing malformed Substrait plans or expressions by returning a proper error instead of calling std::abort().

Copilot AI review requested due to automatic review settings June 26, 2026 07:45
@Reranko05 Reranko05 requested a review from westonpace as a code owner June 26, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants