bkietz commented on code in PR #35628:
URL: https://github.com/apache/arrow/pull/35628#discussion_r1231494102
##########
cpp/src/arrow/compare.cc:
##########
@@ -261,6 +261,36 @@ class RangeDataEqualsImpl {
// Also matches StringType
Status Visit(const BinaryType& type) { return CompareBinary(type); }
+ // Also matches StringViewType
+ Status Visit(const BinaryViewType& type) {
+ auto* left_values = left_.GetValues<StringHeader>(1) + left_start_idx_;
+ auto* right_values = right_.GetValues<StringHeader>(1) + right_start_idx_;
+ if (type.has_raw_pointers()) {
+ VisitValidRuns([&](int64_t i, int64_t length) {
+ for (auto end_i = i + length; i < end_i; ++i) {
+ if (left_values[i] != right_values[i]) {
+ return false;
+ }
+ }
+ return true;
+ });
+ return Status::OK();
+ }
+
+ auto* left_buffers = left_.buffers.data() + 2;
+ auto* right_buffers = right_.buffers.data() + 2;
+ VisitValidRuns([&](int64_t i, int64_t length) {
+ for (auto end_i = i + length; i < end_i; ++i) {
+ if (!left_values[i].EqualsIndexOffset(left_buffers, right_values[i],
+ right_buffers)) {
Review Comment:
StringHeader is still half written for convenient use as with
std::string_view. That's probably an error; especially with the addition of an
index/offset state, StringHeader is an extremely sharp edge and should probably
a) be moved to `internal::` b) provide no member functions which could be
misleading
--
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]