Skip to content

GH-47447: [C++] Fix replace_with_mask for null type arrays#49950

Open
AnkitAhlawat7742 wants to merge 1 commit intoapache:mainfrom
AnkitAhlawat7742:fix/replace_with_mask_crash
Open

GH-47447: [C++] Fix replace_with_mask for null type arrays#49950
AnkitAhlawat7742 wants to merge 1 commit intoapache:mainfrom
AnkitAhlawat7742:fix/replace_with_mask_crash

Conversation

@AnkitAhlawat7742
Copy link
Copy Markdown
Contributor

@AnkitAhlawat7742 AnkitAhlawat7742 commented May 8, 2026

Fix #47447

Rationale for this change

replace_with_mask crashes when called with null type arrays because a code path incorrectly returns Status::OK() from a function with return type Result<int64_t>.
This PR fixes the issue by ensuring the function returns a valid int64_t value instead of Status::OK() for successful executon

What changes are included in this PR?

  1. Fixed the replace_with_mask kernel implementation for null type arrays.
  2. Replaced the invalid Status::OK() return path with a valid int64_t result.
  3. Prevented construction of Result<int64_t> with an OK Status.

Are these changes tested?

Yes, manually run the test case

Are there any user-facing changes?

No

This PR contains a "Critical Fix".

This change fixes a crash in replace_with_mask when operating on null type arrays. The crash occurs due to an invalid successful return path internally constructing Result with Status::OK().

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

⚠️ GitHub issue #47447 has been automatically assigned in GitHub to PR creator.

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.

[C++][Python] replace_with_mask crashes when null type inputs are used

1 participant