This is an automated email from the ASF dual-hosted git repository.
apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 2308cdfeae GH-15192: [C++] Bring back `case_when` tests for union
types (#39308)
2308cdfeae is described below
commit 2308cdfeaedf1af062c25d6edb2eeb1606fb105e
Author: Rossi(Ruoxi) Sun <[email protected]>
AuthorDate: Thu Dec 21 01:55:47 2023 -0800
GH-15192: [C++] Bring back `case_when` tests for union types (#39308)
### Rationale for this change
Bring back the problematic test case of random `case_when` on union(bool,
string) type. This case used to fail. However #36018 already addressed the
issue.
More information about how it used to fail, please refer to
https://github.com/apache/arrow/issues/15192#issuecomment-1862252174.
### What changes are included in this PR?
Bring back the test code.
### Are these changes tested?
Yes, the change is the test.
### Are there any user-facing changes?
No.
* Closes: #15192
Authored-by: zanmato <[email protected]>
Signed-off-by: Antoine Pitrou <[email protected]>
---
cpp/src/arrow/compute/kernels/scalar_if_else_test.cc | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/cpp/src/arrow/compute/kernels/scalar_if_else_test.cc
b/cpp/src/arrow/compute/kernels/scalar_if_else_test.cc
index a11aab8174..771261cac9 100644
--- a/cpp/src/arrow/compute/kernels/scalar_if_else_test.cc
+++ b/cpp/src/arrow/compute/kernels/scalar_if_else_test.cc
@@ -2485,16 +2485,14 @@ TEST(TestCaseWhen, UnionBoolString) {
}
}
-// FIXME(GH-15192): enabling this test produces test failures
-
-// TEST(TestCaseWhen, UnionBoolStringRandom) {
-// for (const auto& type : std::vector<std::shared_ptr<DataType>>{
-// sparse_union({field("a", boolean()), field("b", utf8())}, {2,
7}),
-// dense_union({field("a", boolean()), field("b", utf8())}, {2,
7})}) {
-// ARROW_SCOPED_TRACE(type->ToString());
-// TestCaseWhenRandom(type);
-// }
-// }
+TEST(TestCaseWhen, UnionBoolStringRandom) {
+ for (const auto& type : std::vector<std::shared_ptr<DataType>>{
+ sparse_union({field("a", boolean()), field("b", utf8())}, {2, 7}),
+ dense_union({field("a", boolean()), field("b", utf8())}, {2, 7})}) {
+ ARROW_SCOPED_TRACE(type->ToString());
+ TestCaseWhenRandom(type);
+ }
+}
TEST(TestCaseWhen, DispatchBest) {
CheckDispatchBest("case_when", {struct_({field("", boolean())}), int64(),
int32()},