This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new e8c39fbcce GH-37485: [C++][Skyhook] Don't use deprecated BufferReader 
API (#37486)
e8c39fbcce is described below

commit e8c39fbcce0add78e93be6723a30dec072f9ce4e
Author: Sutou Kouhei <[email protected]>
AuthorDate: Fri Sep 1 00:09:53 2023 +0900

    GH-37485: [C++][Skyhook] Don't use deprecated BufferReader API (#37486)
    
    ### Rationale for this change
    
    GH-37360 deprecated `BufferReader(const uint8_t*, int64_t)`.
    
    ### What changes are included in this PR?
    
    Use `BufferReader(std::shared_ptr<Buffer>)` instead.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    No.
    * Closes: #37485
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Antoine Pitrou <[email protected]>
---
 cpp/src/skyhook/protocol/skyhook_protocol.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/cpp/src/skyhook/protocol/skyhook_protocol.cc 
b/cpp/src/skyhook/protocol/skyhook_protocol.cc
index f83b124553..3b1234c6ed 100644
--- a/cpp/src/skyhook/protocol/skyhook_protocol.cc
+++ b/cpp/src/skyhook/protocol/skyhook_protocol.cc
@@ -73,10 +73,12 @@ arrow::Status DeserializeScanRequest(ceph::bufferlist& bl, 
ScanRequest* req) {
   req->partition_expression = partition_expression;
 
   arrow::ipc::DictionaryMemo empty_memo;
-  arrow::io::BufferReader 
projection_schema_reader(request->projection_schema()->data(),
-                                                   
request->projection_schema()->size());
-  arrow::io::BufferReader 
dataset_schema_reader(request->dataset_schema()->data(),
-                                                
request->dataset_schema()->size());
+  auto projection_schema_buffer = std::make_shared<arrow::Buffer>(
+      request->projection_schema()->data(), 
request->projection_schema()->size());
+  arrow::io::BufferReader 
projection_schema_reader(std::move(projection_schema_buffer));
+  auto dataset_schema_buffer = std::make_shared<arrow::Buffer>(
+      request->dataset_schema()->data(), request->dataset_schema()->size());
+  arrow::io::BufferReader 
dataset_schema_reader(std::move(dataset_schema_buffer));
 
   ARROW_ASSIGN_OR_RAISE(req->projection_schema,
                         arrow::ipc::ReadSchema(&projection_schema_reader, 
&empty_memo));

Reply via email to