Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cpp/src/arrow/compute/kernels/scalar_if_else_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3144,6 +3144,14 @@ TEST(TestCoalesce, Boolean) {
ArrayFromJSON(type, "[true, true, false, true]"));
CheckScalar("coalesce", {scalar1, values1},
ArrayFromJSON(type, "[false, false, false, false]"));

// Regression test for GH-47234, which was failing due to a MSVC compiler bug
// (possibly https://developercommunity.visualstudio.com/t/10912292
// or https://developercommunity.visualstudio.com/t/10945478).
auto values_with_null = ArrayFromJSON(type, "[true, false, false, false, false, null]");
auto expected = ArrayFromJSON(type, "[true, false, false, false, false, true]");
auto scalar2 = ScalarFromJSON(type, "true");
CheckScalar("coalesce", {values_with_null, scalar2}, expected);
Comment on lines +3151 to +3154
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amoeba following your repro I'm trying the same in cpp.

}

TEST(TestCoalesce, DayTimeInterval) {
Expand Down
22 changes: 22 additions & 0 deletions python/pyarrow/tests/test_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,28 @@ def test_fill_null_chunked_array(arrow_type):
assert result.equals(expected)


def test_fill_null_windows_regression():
# Regression test for GH-47234, which was failing due to a MSVC compiler bug
# (possibly https://developercommunity.visualstudio.com/t/10912292
# or https://developercommunity.visualstudio.com/t/10945478)
arr = pa.array([True, False, False, False, False, None])
s = pa.scalar(True, type=pa.bool_())

result = pa.compute.call_function("coalesce", [arr, s])
result.validate(full=True)
expected = pa.array([True, False, False, False, False, True])
assert result.equals(expected)

for ty in [pa.int8(), pa.int16(), pa.int32(), pa.int64()]:
arr = pa.array([1, 2, 3, 4, 5, None], type=ty)
s = pa.scalar(42, type=ty)

result = pa.compute.call_function("coalesce", [arr, s])
result.validate(full=True)
expected = pa.array([1, 2, 3, 4, 5, 42], type=ty)
assert result.equals(expected)


def test_logical():
a = pa.array([True, False, False, None])
b = pa.array([True, True, False, True])
Expand Down
Loading