lidavidm commented on code in PR #1148:
URL: https://github.com/apache/arrow-adbc/pull/1148#discussion_r1347861432


##########
c/driver/postgresql/postgres_copy_reader.h:
##########
@@ -1260,10 +1245,13 @@ class PostgresCopyStreamWriter {
     return NANOARROW_OK;
   }
 
+  const uint8_t* BufferData() const { return buffer_.value.data; }

Review Comment:
   hmm, maybe `const struct ArrowBuffer&`, which would give you size too? (If 
only we had `std::span` or `std::string_view`...)



##########
c/driver/postgresql/postgres_copy_reader.h:
##########
@@ -1215,27 +1202,25 @@ class PostgresCopyStreamWriter {
         ArrowArrayViewInitFromSchema(&array_view_.value, schema, nullptr));
     NANOARROW_RETURN_NOT_OK(ArrowArrayViewSetArray(&array_view_.value, array, 
nullptr));
     root_writer_.Init(&array_view_.value);
+    ArrowBufferInit(&buffer_.value);
     return NANOARROW_OK;
   }
 
-  ArrowErrorCode WriteHeader(ArrowBuffer* buffer, ArrowError* error) {
-    ArrowBufferAppend(buffer, kPgCopyBinarySignature, 
sizeof(kPgCopyBinarySignature));
+  ArrowErrorCode WriteHeader(ArrowError* error) {
+    ArrowBufferAppend(&buffer_.value, kPgCopyBinarySignature,

Review Comment:
   I overlooked this the first time, but shouldn't we be checking the return 
codes for these calls?



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