Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
361950e
GH-33295: [C++] Add list_contains kernel
jonasdedden Sep 28, 2026
e3844d8
GH-33295: [C++] Test list_contains kernel
jonasdedden Sep 28, 2026
459673d
GH-33295: [Docs] Document list_contains
jonasdedden Sep 28, 2026
60610ce
GH-33295: [Python] Test list_contains
jonasdedden Sep 28, 2026
7349c0e
GH-33295: [C++] Support arrays of values in list_contains
jonasdedden Sep 28, 2026
7004d33
GH-33295: [C++] Type-check null values in list_contains
jonasdedden Sep 28, 2026
cb3cea8
GH-33295: [C++] Match float16 NaN values in list_contains
jonasdedden Sep 28, 2026
441fdb3
GH-33295: [C++] Only compare child values referenced by list views in…
jonasdedden Sep 28, 2026
acc42f1
GH-33295: [C++] Stop at the first match in list_contains
jonasdedden Sep 28, 2026
2d1b613
GH-33295: [C++] Share one code path for all list types and values in …
jonasdedden Sep 28, 2026
95d6b87
GH-33295: [C++] Condense list_contains tests
jonasdedden Sep 28, 2026
972bc4c
GH-33295: [C++] Speed up the list_contains scan for short lists
jonasdedden Sep 30, 2026
e45a284
GH-33295: [C++] Search each list for its query in list_contains
jonasdedden Oct 14, 2026
8c73488
GH-33295: [C++] Look up queries in a scalar list with is_in in list_c…
jonasdedden Oct 14, 2026
a335e19
GH-33295: [C++] Check null queries like other queries in list_contains
jonasdedden Oct 14, 2026
f4628d4
GH-33295: [C++] Fix -Wbitwise-instead-of-logical in list_contains
jonasdedden Oct 15, 2026
6fc4996
GH-33295: [C++] Match NaNs with any payload for scalar lists in list_…
jonasdedden Oct 21, 2026
0110702
GH-33295: [C++] Support zero-width fixed-size binary in list_contains
jonasdedden Oct 21, 2026
d9dd833
GH-33295: [C++] Only cast child values that list views reference in l…
jonasdedden Oct 21, 2026
cb5b082
GH-33295: [C++] Compare float16 null queries as float32 in list_contains
jonasdedden Oct 22, 2026
b946a72
GH-33295: [C++] Check the types of null scalar lists in list_contains
jonasdedden Oct 22, 2026
54532f4
GH-33295: [C++] Share comparison type validation with list_contains i…
jonasdedden Oct 22, 2026
6fdfc18
GH-33295: [C++] Never match fixed-size binary values of other widths …
jonasdedden Oct 22, 2026
cbda884
GH-33295: [C++] Raise for types list_contains can't cast between, als…
jonasdedden Oct 22, 2026
21030b7
GH-33295: [C++] Compare types once per list_contains call, also witho…
jonasdedden Oct 22, 2026
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
13 changes: 13 additions & 0 deletions cpp/src/arrow/compute/kernels/codegen_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,19 @@ TypeHolder CommonBinary(const TypeHolder* begin, size_t count) {
return large_binary();
}

Status ValidateComparison(const DataType& lhs, const DataType& rhs) {
if (lhs.id() == Type::TIMESTAMP && rhs.id() == Type::TIMESTAMP) {
const auto& lhs_timestamp = checked_cast<const TimestampType&>(lhs);
const auto& rhs_timestamp = checked_cast<const TimestampType&>(rhs);
if (lhs_timestamp.timezone().empty() ^ rhs_timestamp.timezone().empty()) {
return Status::Invalid(
"Cannot compare timestamp with timezone to timestamp without timezone, got: ",
lhs, " and ", rhs);
}
}
return Status::OK();
}

bool CastableToDecimal(const DataType& type) {
return is_numeric(type.id()) || is_decimal(type.id());
}
Expand Down
5 changes: 5 additions & 0 deletions cpp/src/arrow/compute/kernels/codegen_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1459,6 +1459,11 @@ bool CommonTemporalResolution(const TypeHolder* begin, size_t count,
ARROW_EXPORT
TypeHolder CommonBinary(const TypeHolder* begin, size_t count);

/// Raise the errors comparing values of these types fails with beyond dispatch,
/// such as for timestamps where only one has a time zone.
ARROW_EXPORT
Status ValidateComparison(const DataType& lhs, const DataType& rhs);

/// How to promote decimal precision/scale in CastBinaryDecimalArgs.
enum class DecimalPromotion : uint8_t {
kAdd,
Expand Down
8 changes: 1 addition & 7 deletions cpp/src/arrow/compute/kernels/scalar_compare.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,7 @@ struct CompareKernel {
template <typename Op>
struct CompareTimestamps {
static Status Exec(KernelContext* ctx, const ExecSpan& batch, ExecResult* out) {
const auto& lhs = checked_cast<const TimestampType&>(*batch[0].type());
const auto& rhs = checked_cast<const TimestampType&>(*batch[1].type());
if (lhs.timezone().empty() ^ rhs.timezone().empty()) {
return Status::Invalid(
"Cannot compare timestamp with timezone to timestamp without timezone, got: ",
lhs, " and ", rhs);
}
RETURN_NOT_OK(ValidateComparison(*batch[0].type(), *batch[1].type()));
return CompareKernel<Int64Type>::Exec(ctx, batch, out);
}
};
Expand Down
Loading
Loading