Skip to content

Commit

Permalink
MINOR: [C++] Use the array returned by TweakValidityBit (apache#14221)
Browse files Browse the repository at this point in the history
TweakValidityBit returns a new Array so the calling function should use it.
https://github.com/apache/arrow/blob/6cc37cf2d1ba72c46b64fbc7ac499bd0d7296d20/cpp/src/arrow/testing/gtest_util.cc#L568-L579

Authored-by: kshitij12345 <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
kshitij12345 authored and fatemehp committed Oct 17, 2022
1 parent d5bfb62 commit bf35c46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/src/arrow/compute/kernels/vector_nested_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ TEST(TestVectorNested, ListFlatten) {
CheckVectorUnary("list_flatten", input, expected);

// Construct a list with a non-empty null slot
TweakValidityBit(input, 0, false);
auto tweaked = TweakValidityBit(input, 0, false);
expected = ArrayFromJSON(int16(), "[2, 3]");
CheckVectorUnary("list_flatten", input, expected);
CheckVectorUnary("list_flatten", tweaked, expected);
}
}

Expand Down Expand Up @@ -86,9 +86,9 @@ TEST(TestVectorNested, ListParentIndices) {

// Construct a list with a non-empty null slot
auto input = ArrayFromJSON(list(int16()), "[[0, null, 1], [0, 0], [2, 3], [], [4, 5]]");
TweakValidityBit(input, 1, false);
auto tweaked = TweakValidityBit(input, 1, false);
auto expected = ArrayFromJSON(int64(), "[0, 0, 0, 1, 1, 2, 2, 4, 4]");
CheckVectorUnary("list_parent_indices", input, expected);
CheckVectorUnary("list_parent_indices", tweaked, expected);
}

TEST(TestVectorNested, ListParentIndicesChunkedArray) {
Expand Down

0 comments on commit bf35c46

Please sign in to comment.