kou commented on a change in pull request #11399:
URL: https://github.com/apache/arrow/pull/11399#discussion_r730574802



##########
File path: cpp/examples/parquet/parquet_stream_api/stream_reader_writer.cc
##########
@@ -136,12 +137,14 @@ struct TestData {
     return "Str #" + std::to_string(i);
   }
   static arrow::util::string_view GetStringView(const int i) {
-    string_ = "StringView #" + std::to_string(i);
+    int length = snprintf(string_, str_buff_size, "StringView #%d", i);
+    snprintf(string_, length + 1, "StringView #%d", i);
     return arrow::util::string_view(string_);

Review comment:
       I tried `static std::string` in function not class and the following 
error could be suppressed:
   
   https://github.com/apache/arrow/runs/3883052477#step:7:5583
   
   ```text
   /arrow/cpp/examples/parquet/parquet_stream_api/stream_reader_writer.cc:171:  
Static/global string variables are not permitted.  [runtime/string] [4]
   ```
   
   Is the `static std::string` in function denied in our lint?




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