WillAyd commented on code in PR #45272: URL: https://github.com/apache/arrow/pull/45272#discussion_r2178600735
########## cpp/src/arrow/compute/kernels/scalar_compare.cc: ########## @@ -445,6 +445,14 @@ std::shared_ptr<ScalarFunction> MakeCompareFunction(std::string name, FunctionDo DCHECK_OK(func->AddKernel({ty, ty}, boolean(), std::move(exec))); } + if constexpr (std::is_same_v<Op, Equal> || std::is_same_v<Op, NotEqual>) { + for (const auto id : {Type::LIST, Type::LARGE_LIST}) { + auto exec = GenerateList<applicator::ScalarBinaryEqualTypes, BooleanType, Op>(id); Review Comment: OK sorry for the long delay in getting back to this. I think I have a structure working but I'm unclear on if there's a bug with the RangeDataEqualsImpl implementation or if I am misunderstanding its purpose. As an example, I am trying to compare two list arrays, where the first is: ``` [4, 5, 6] ``` and the second is: ``` [4, 5] ``` When calling RangeDataEqualsImpl::Compare with these two values, I am getting back `true`. The current Compare implementation looks like: ```cpp bool Compare() { // Compare null bitmaps if (left_start_idx_ == 0 && right_start_idx_ == 0 && range_length_ == left_.length && range_length_ == right_.length) { // If we're comparing entire arrays, we can first compare the cached null counts if (left_.GetNullCount() != right_.GetNullCount()) { return false; } } if (!OptionalBitmapEquals(left_.buffers[0], left_.offset + left_start_idx_, right_.buffers[0], right_.offset + right_start_idx_, range_length_)) { return false; } // Compare values return CompareWithType(*left_.type); } ``` So the first branch is entirely ignored because the length of the two `ArrayData` instances are not equal. Ultimately this falls down to the `CompareWithType(*left_.type)` call at the bottom of the method, but the `ArrayData->type` member reports back as INT32. So is this a problem with the implementation of `Compare` where it should be short circuiting when the ArrayData lengths are not equal? And/or is the fact that the `ArrayData->type` member is coming back as INT32 and not as a List element the problem? -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org