mapleFU commented on code in PR #46730:
URL: https://github.com/apache/arrow/pull/46730#discussion_r2159249895


##########
cpp/src/arrow/array/builder_binary.h:
##########
@@ -645,6 +664,35 @@ class ARROW_EXPORT BinaryViewBuilder : public ArrayBuilder 
{
     UnsafeAppend(value.data(), static_cast<int64_t>(value.size()));
   }
 
+  Result<int32_t> AppendBuffer(const uint8_t* value, const int64_t length) {
+    if (ARROW_PREDICT_FALSE(length <= TypeClass::kInlineSize)) {
+      return Status::Invalid(
+          "The size of buffer to append should be larger than kInlineSize");
+    }
+    ARROW_RETURN_NOT_OK(data_heap_builder_.FinishLastBlock());
+    ARROW_ASSIGN_OR_RAISE(auto v,
+                          data_heap_builder_.Append</*Safe=*/true>(value, 
length));
+    return v.ref.buffer_index;
+  }
+
+  Result<int32_t> AppendBuffer(const char* value, const int64_t length) {
+    return AppendBuffer(reinterpret_cast<const uint8_t*>(value), length);
+  }
+
+  Result<int32_t> AppendBuffer(const std::string& value) {

Review Comment:
   Can we remove this one since std::string_view is added here?



-- 
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]

Reply via email to