Skip to content

GH-50231: [C++] Handle unset Substrait extension mapping type#50263

Merged
kou merged 1 commit into
apache:mainfrom
Reranko05:gh-50231-substrait-unreachable
Jun 28, 2026
Merged

GH-50231: [C++] Handle unset Substrait extension mapping type#50263
kou merged 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.

@Reranko05

Copy link
Copy Markdown
Contributor Author

@kou Whenever you have some time, I'd really appreciate it if you could take a look at this PR.

The Substrait tests are passing, but there are two remaining CI failures (arrow-s3fs-test timeout on ARM64 macOS and the Python Sphinx/Numpydoc job). From what I can tell, they don't appear to be related to this change, but I'd appreciate your thoughts. Thanks!

@kou kou changed the title GH-50231: Handle unset Substrait extension mapping type GH-50231: [C++] Handle unset Substrait extension mapping type Jun 28, 2026

@kou kou 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.

+1

@kou kou merged commit 29c9361 into apache:main Jun 28, 2026
54 of 56 checks passed
@kou kou removed the awaiting review Awaiting review label Jun 28, 2026
@github-actions github-actions Bot added the awaiting merge Awaiting merge label Jun 28, 2026
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 29c9361.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

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.

3 participants