kou commented on code in PR #49436:
URL: https://github.com/apache/arrow/pull/49436#discussion_r2888636173


##########
cpp/src/arrow/flight/sql/server.cc:
##########
@@ -537,7 +537,9 @@ arrow::Result<std::string> CreateStatementQueryTicket(
   ticket_statement_query.set_statement_handle(statement_handle);
 
   google::protobuf::Any ticket;
-  ticket.PackFrom(ticket_statement_query);
+  // PackFrom returns void for older protobuf versions and [[nodiscard]] bool
+  // for newer versions, so we explicitly ignore the return value.
+  (void)ticket.PackFrom(ticket_statement_query);

Review Comment:
   How about using `#if` like other code such as 
https://github.com/apache/arrow/blob/8e625d0a34e6b668674b2e1be526752000d5c462/cpp/src/arrow/flight/sql/server.cc#L436-L442
 ?
   
   ```suggestion
   #if PROTOBUF_VERSION >= 3015000
     if (!ticket.PackFrom(ticket_statement_query)) {
       return Status::IOError("Failed to pack ticket");
     }
   #else
     ticket.PackFrom(ticket_statement_query);
   #endif
   ```



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