You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/11 18:04:10 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #10295: ARROW-11161: [C++][Python] Add stream metadata

pitrou commented on a change in pull request #10295:
URL: https://github.com/apache/arrow/pull/10295#discussion_r630409762



##########
File path: cpp/src/arrow/io/interfaces.h
##########
@@ -49,6 +49,26 @@ struct ReadRange {
   }
 };
 
+struct StreamMetadata {
+  struct KeyValue {
+    std::string key;
+    std::string value;
+
+    KeyValue() = default;
+    KeyValue(std::string key, std::string value)
+        : key(std::move(key)), value(std::move(value)) {}
+
+    friend bool operator==(const KeyValue& left, const KeyValue& right) {
+      return (left.key == right.key && left.value == right.value);
+    }
+    friend bool operator!=(const KeyValue& left, const KeyValue& right) {
+      return !(left == right);
+    }
+  };
+
+  std::vector<KeyValue> items;
+};

Review comment:
       I'm not sure about this API. Do we want to simplify this to `using StreamMetadata = std::vector<...>`? Do we want to add a `shared_ptr` somewhere to minimize copies (but I don't think this is performance-critical)?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org