GH-50109: [C++][Gandiva] Fix incorrect error messages#50110
Open
lriggs wants to merge 1 commit into
Open
Conversation
|
|
dmitry-chirkov-dremio
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Three small, independent bugs in Gandiva's runtime error messages: in two cases the message misrepresents what actually failed, and in one case a copy-paste error left the wrong function name in a message.
What changes are included in this PR?
1.
levenshteinreported OOM as a length errorcpp/src/gandiva/precompiled/string_ops.cc:1738-1742 — when
gdv_fn_context_arena_mallocreturned null (i.e. memory allocation failed), the function set the error to"String length must be greater than 0". The condition is an OOM, not a length issue. Now reports"LEVENSHTEIN: could not allocate working memory".2.
levenshteinlength-bound message was off by onecpp/src/gandiva/precompiled/string_ops.cc:1702-1708 — the precondition is
in1_len < 0 || in2_len < 0, which rejects only negative lengths (zero is valid). The message said"must be greater than 0", implying zero was rejected too. Corrected to"LEVENSHTEIN: input lengths must be non-negative, got <a> and <b>", which now also echoes the offending values.3.
gdv_fn_aes_decryptreported the wrong directioncpp/src/gandiva/gdv_function_stubs.cc:411 — inside the AES decrypt function, the OOM message said
"Could not allocate memory for returning aes encrypt cypher text". Pure copy-paste from the sibling encrypt function. Corrected the direction wording.Test updates
cpp/src/gandiva/precompiled/string_ops_test.cc:1133-1135 — the levenshtein test was asserting
HasSubstr("String length must be greater than 0"), which was matching the bug message — i.e. the test was effectively verifying the wrong behavior. Updated to assert the corrected message substring.Are these changes tested?
Are there any user-facing changes?
Yes, improved error message accuracy.