Skip to content

[C++][Compute] Function if_else emits wrong results for chunked inputs #47825

@zanmato1984

Description

@zanmato1984

Describe the bug, including details regarding any error messages, version, and platform.

A C++ repro:

TEST(TestIfElse, Reproduce) {
  auto cond = ArrayFromJSON(boolean(), "[true, true]");
  auto if_true = ChunkedArrayFromJSON(boolean(), {"[true]", "[true]"});
  auto if_false = ArrayFromJSON(boolean(), "[true, true]");
  ASSERT_OK_AND_ASSIGN(auto result, CallFunction("if_else", {cond, if_true, if_false}));
  ASSERT_OK(result.chunked_array()->ValidateFull());
  AssertDatumsEqual(ChunkedArrayFromJSON(boolean(), {"[true, true]"}), result);
}

Error:

$116│ │ Failure @ src/arrow/testing/gtest_util.cc:204
$116│ │ │ Failed
$116│ │ │ Got:
$116│ │ │   [
$116│ │ │     [
$116│ │ │       false,
$116│ │ │       true
$116│ │ │     ]
$116│ │ │   ]
$116│ │ │ Expected:
$116│ │ │   [
$116│ │ │     [
$116│ │ │       true,
$116│ │ │       true
$116│ │ │     ]
$116│ │ │   ]
$116│ │ │ 
$116│ [  FAILED  ] TestIfElse.Reproduce (0 ms)

Component(s)

C++

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions