pitrou commented on code in PR #36058:
URL: https://github.com/apache/arrow/pull/36058#discussion_r1238403057
##########
cpp/src/arrow/compute/kernels/scalar_set_lookup_test.cc:
##########
@@ -238,6 +239,29 @@ TEST_F(TestIsInKernel, TimeTimestamp) {
"[true, false, true]");
}
+TEST_F(TestIsInKernel, TimeDuration) {
+ for (const auto& type : DurationTypes()) {
+ CheckIsIn(type, "[1, null, 5, 1, 2]", "[2, 1, null]",
+ "[true, true, false, true, true]", /*skip_nulls=*/false);
+ CheckIsIn(type, "[1, null, 5, 1, 2]", "[2, 1, null]",
+ "[true, false, false, true, true]", /*skip_nulls=*/true);
+
+ // Duplicates in right array
+ CheckIsIn(type, "[1, null, 5, 1, 2]", "[2, 1, 1, null, 2]",
+ "[true, true, false, true, true]", /*skip_nulls=*/false);
+ CheckIsIn(type, "[1, null, 5, 1, 2]", "[2, 1, 1, null, 2]",
+ "[true, false, false, true, true]", /*skip_nulls=*/true);
+ }
+
+ // Different units, invalid cast
Review Comment:
Interesting... ideally, the values could be cast to MILLI instead of casting
the value_set to SECOND. Don't have to solve this here, though. :-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]