{"action":"created","comment":{"url":"https://api.github.com/repos/apache/parquet-cpp/pulls/comments/76598898","id":76598898,"diff_hunk":"@@ -0,0 +1,190 @@\n+// Licensed to the Apache Software Foundation (ASF) under one\n+// or more contributor license agreements.  See the NOTICE file\n+// distributed with this work for additional information\n+// regarding copyright ownership.  The ASF licenses this file\n+// to you under the Apache License, Version 2.0 (the\n+// \"License\"); you may not use this file except in compliance\n+// with the License.  You may obtain a copy of the License at\n+//\n+//   http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing,\n+// software distributed under the License is distributed on an\n+// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+// KIND, either express or implied.  See the License for the\n+// specific language governing permissions and limitations\n+// under the License.\n+\n+#ifndef PARQUET_FILE_METADATA_H\n+#define PARQUET_FILE_METADATA_H\n+\n+#include <string>\n+#include <vector>\n+#include <set>\n+\n+#include \"parquet/column/properties.h\"\n+#include \"parquet/compression/codec.h\"\n+#include \"parquet/schema/descriptor.h\"\n+#include \"parquet/types.h\"\n+#include \"parquet/util/output.h\"\n+#include \"parquet/util/visibility.h\"\n+\n+namespace parquet {\n+\n+struct ColumnStatistics {\n+  int64_t null_count;\n+  int64_t distinct_count;\n+  const std::string* min;\n+  const std::string* max;\n+};\n+\n+class PARQUET_EXPORT ColumnMetaData {\n+ public:\n+  // API convenience to get a MetaData accessor\n+  static std::unique_ptr<ColumnMetaData> GetColumnMetaData(const uint8_t* metadata);\n+\n+  explicit ColumnMetaData(const uint8_t* metadata);\n+  ~ColumnMetaData();\n+\n+  // column chunk\n+  int64_t file_offset() const;\n+  const std::string& file_path() const;\n+  // column metadata\n+  Type::type type() const;\n+  int64_t num_values() const;\n+  std::shared_ptr<schema::ColumnPath> path_in_schema() const;\n+  bool is_stats_set() const;\n+  ColumnStatistics Stats() const;\n+  Compression::type compression() const;\n+  std::vector<Encoding::type> Encodings() const;\n+  int64_t total_compressed_size() const;\n+  int64_t total_uncompressed_size() const;\n+\n+ private:\n+  // PIMPL Idiom\n+  class ColumnMetaDataImpl;\n+  std::unique_ptr<ColumnMetaDataImpl> impl_;\n+};\n+\n+class PARQUET_EXPORT RowGroupMetaData {\n+ public:\n+  // API convenience to get a MetaData accessor\n+  static std::unique_ptr<RowGroupMetaData> GetRowGroupMetaData(const uint8_t* metadata);\n+\n+  explicit RowGroupMetaData(const uint8_t* metadata);\n+  ~RowGroupMetaData();\n+\n+  // row-group metadata\n+  int num_columns() const;\n+  int64_t num_rows() const;\n+  int64_t total_byte_size() const;\n+  std::unique_ptr<ColumnMetaData> GetColumnMetaData(int i) const;\n+\n+ private:\n+  // PIMPL Idiom\n+  class RowGroupMetaDataImpl;\n+  std::unique_ptr<RowGroupMetaDataImpl> impl_;\n+};\n+\n+class PARQUET_EXPORT FileMetaData {\n+ public:\n+  // API convenience to get a MetaData accessor\n+  static std::unique_ptr<FileMetaData> GetFileMetaData(const uint8_t* metadata);\n+\n+  explicit FileMetaData(const uint8_t* metadata);\n+  ~FileMetaData();\n+\n+  // file metadata\n+  int64_t num_rows() const;\n+  int num_row_groups() const;\n+  int32_t version() const;\n+  const std::string& created_by() const;\n+  int num_schema_elements() const;\n+  std::unique_ptr<RowGroupMetaData> GetRowGroupMetaData(int i) const;\n+\n+  void WriteTo(OutputStream* dst);\n+\n+  // Return const-pointer to make it clear that this object is not to be copied\n+  const SchemaDescriptor* schema() const;\n+\n+ private:\n+  // PIMPL Idiom\n+  class FileMetaDataImpl;\n+  std::unique_ptr<FileMetaDataImpl> impl_;\n+};\n+\n+// Builder API\n+class PARQUET_EXPORT ColumnMetaDataBuilder {\n+ public:\n+  // API convenience to get a MetaData reader\n+  static std::unique_ptr<ColumnMetaDataBuilder> GetColumnMetaDataBuilder(\n+      const std::shared_ptr<WriterProperties>& props, const ColumnDescriptor* column,\n+      uint8_t* contents);\n+\n+  explicit ColumnMetaDataBuilder(const std::shared_ptr<WriterProperties>& props,\n+      const ColumnDescriptor* column, uint8_t* contents);\n+  ~ColumnMetaDataBuilder();\n+\n+  // column chunk\n+  // Used when a dataset is spread across multiple files\n+  void set_file_path(const std::string& path);\n+  // column metadata\n+  void SetStatistics(const ColumnStatistics& stats);","path":"src/parquet/file/metadata.h","position":132,"original_position":132,"commit_id":"ddbf37ef6f97e05b0fc8ddd2276b5f400edc785e","original_commit_id":"ddbf37ef6f97e05b0fc8ddd2276b5f400edc785e","user":{"login":"xhochy","id":70274,"avatar_url":"https://avatars.githubusercontent.com/u/70274?v=3","gravatar_id":"","url":"https://api.github.com/users/xhochy","html_url":"https://github.com/xhochy","followers_url":"https://api.github.com/users/xhochy/followers","following_url":"https://api.github.com/users/xhochy/following{/other_user}","gists_url":"https://api.github.com/users/xhochy/gists{/gist_id}","starred_url":"https://api.github.com/users/xhochy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xhochy/subscriptions","organizations_url":"https://api.github.com/users/xhochy/orgs","repos_url":"https://api.github.com/users/xhochy/repos","events_url":"https://api.github.com/users/xhochy/events{/privacy}","received_events_url":"https://api.github.com/users/xhochy/received_events","type":"User","site_admin":false},"body":"As mentioned before: A comment about the ownership semantics of min/max would be nice.","created_at":"2016-08-29T12:34:50Z","updated_at":"2016-08-29T12:34:50Z","html_url":"https://github.com/apache/parquet-cpp/pull/143#discussion_r76598898","pull_request_url":"https://api.github.com/repos/apache/parquet-cpp/pulls/143","_links":{"self":{"href":"https://api.github.com/repos/apache/parquet-cpp/pulls/comments/76598898"},"html":{"href":"https://github.com/apache/parquet-cpp/pull/143#discussion_r76598898"},"pull_request":{"href":"https://api.github.com/repos/apache/parquet-cpp/pulls/143"}}},"pull_request":{"url":"https://api.github.com/repos/apache/parquet-cpp/pulls/143","id":81901970,"html_url":"https://github.com/apache/parquet-cpp/pull/143","diff_url":"https://github.com/apache/parquet-cpp/pull/143.diff","patch_url":"https://github.com/apache/parquet-cpp/pull/143.patch","issue_url":"https://api.github.com/repos/apache/parquet-cpp/issues/143","number":143,"state":"open","locked":false,"title":"PARQUET-573: Create a public API for reading and writing file metadata","user":{"login":"majetideepak","id":5091159,"avatar_url":"https://avatars.githubusercontent.com/u/5091159?v=3","gravatar_id":"","url":"https://api.github.com/users/majetideepak","html_url":"https://github.com/majetideepak","followers_url":"https://api.github.com/users/majetideepak/followers","following_url":"https://api.github.com/users/majetideepak/following{/other_user}","gists_url":"https://api.github.com/users/majetideepak/gists{/gist_id}","starred_url":"https://api.github.com/users/majetideepak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majetideepak/subscriptions","organizations_url":"https://api.github.com/users/majetideepak/orgs","repos_url":"https://api.github.com/users/majetideepak/repos","events_url":"https://api.github.com/users/majetideepak/events{/privacy}","received_events_url":"https://api.github.com/users/majetideepak/received_events","type":"User","site_admin":false},"body":"This patch adds API to read and write metadata as well as improves the writer properties class.\r\nI am planning to add some comments to the code next. Meanwhile, any feedback will be helpful.","created_at":"2016-08-18T22:54:45Z","updated_at":"2016-08-29T12:34:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"878310ceb529599b67d1d4a3ad58583f3d2fe4f5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/parquet-cpp/pulls/143/commits","review_comments_url":"https://api.github.com/repos/apache/parquet-cpp/pulls/143/comments","review_comment_url":"https://api.github.com/repos/apache/parquet-cpp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/parquet-cpp/issues/143/comments","statuses_url":"https://api.github.com/repos/apache/parquet-cpp/statuses/ddbf37ef6f97e05b0fc8ddd2276b5f400edc785e","head":{"label":"majetideepak:metadata","ref":"metadata","sha":"ddbf37ef6f97e05b0fc8ddd2276b5f400edc785e","user":{"login":"majetideepak","id":5091159,"avatar_url":"https://avatars.githubusercontent.com/u/5091159?v=3","gravatar_id":"","url":"https://api.github.com/users/majetideepak","html_url":"https://github.com/majetideepak","followers_url":"https://api.github.com/users/majetideepak/followers","following_url":"https://api.github.com/users/majetideepak/following{/other_user}","gists_url":"https://api.github.com/users/majetideepak/gists{/gist_id}","starred_url":"https://api.github.com/users/majetideepak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majetideepak/subscriptions","organizations_url":"https://api.github.com/users/majetideepak/orgs","repos_url":"https://api.github.com/users/majetideepak/repos","events_url":"https://api.github.com/users/majetideepak/events{/privacy}","received_events_url":"https://api.github.com/users/majetideepak/received_events","type":"User","site_admin":false},"repo":{"id":49598967,"name":"parquet-cpp","full_name":"majetideepak/parquet-cpp","owner":{"login":"majetideepak","id":5091159,"avatar_url":"https://avatars.githubusercontent.com/u/5091159?v=3","gravatar_id":"","url":"https://api.github.com/users/majetideepak","html_url":"https://github.com/majetideepak","followers_url":"https://api.github.com/users/majetideepak/followers","following_url":"https://api.github.com/users/majetideepak/following{/other_user}","gists_url":"https://api.github.com/users/majetideepak/gists{/gist_id}","starred_url":"https://api.github.com/users/majetideepak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majetideepak/subscriptions","organizations_url":"https://api.github.com/users/majetideepak/orgs","repos_url":"https://api.github.com/users/majetideepak/repos","events_url":"https://api.github.com/users/majetideepak/events{/privacy}","received_events_url":"https://api.github.com/users/majetideepak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/majetideepak/parquet-cpp","description":"Mirror of Apache Parquet","fork":true,"url":"https://api.github.com/repos/majetideepak/parquet-cpp","forks_url":"https://api.github.com/repos/majetideepak/parquet-cpp/forks","keys_url":"https://api.github.com/repos/majetideepak/parquet-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/majetideepak/parquet-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/majetideepak/parquet-cpp/teams","hooks_url":"https://api.github.com/repos/majetideepak/parquet-cpp/hooks","issue_events_url":"https://api.github.com/repos/majetideepak/parquet-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/majetideepak/parquet-cpp/events","assignees_url":"https://api.github.com/repos/majetideepak/parquet-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/majetideepak/parquet-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/majetideepak/parquet-cpp/tags","blobs_url":"https://api.github.com/repos/majetideepak/parquet-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/majetideepak/parquet-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/majetideepak/parquet-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/majetideepak/parquet-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/majetideepak/parquet-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/majetideepak/parquet-cpp/languages","stargazers_url":"https://api.github.com/repos/majetideepak/parquet-cpp/stargazers","contributors_url":"https://api.github.com/repos/majetideepak/parquet-cpp/contributors","subscribers_url":"https://api.github.com/repos/majetideepak/parquet-cpp/subscribers","subscription_url":"https://api.github.com/repos/majetideepak/parquet-cpp/subscription","commits_url":"https://api.github.com/repos/majetideepak/parquet-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/majetideepak/parquet-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/majetideepak/parquet-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/majetideepak/parquet-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/majetideepak/parquet-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/majetideepak/parquet-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/majetideepak/parquet-cpp/merges","archive_url":"https://api.github.com/repos/majetideepak/parquet-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/majetideepak/parquet-cpp/downloads","issues_url":"https://api.github.com/repos/majetideepak/parquet-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/majetideepak/parquet-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/majetideepak/parquet-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/majetideepak/parquet-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/majetideepak/parquet-cpp/labels{/name}","releases_url":"https://api.github.com/repos/majetideepak/parquet-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/majetideepak/parquet-cpp/deployments","created_at":"2016-01-13T20:12:53Z","updated_at":"2016-03-17T14:07:22Z","pushed_at":"2016-08-29T04:59:34Z","git_url":"git://github.com/majetideepak/parquet-cpp.git","ssh_url":"git@github.com:majetideepak/parquet-cpp.git","clone_url":"https://github.com/majetideepak/parquet-cpp.git","svn_url":"https://github.com/majetideepak/parquet-cpp","homepage":null,"size":1006,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"0a0323d850a00f168b5e6e2b51df607d63323846","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20675634,"name":"parquet-cpp","full_name":"apache/parquet-cpp","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/parquet-cpp","description":"Mirror of Apache Parquet","fork":false,"url":"https://api.github.com/repos/apache/parquet-cpp","forks_url":"https://api.github.com/repos/apache/parquet-cpp/forks","keys_url":"https://api.github.com/repos/apache/parquet-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/parquet-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/parquet-cpp/teams","hooks_url":"https://api.github.com/repos/apache/parquet-cpp/hooks","issue_events_url":"https://api.github.com/repos/apache/parquet-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/apache/parquet-cpp/events","assignees_url":"https://api.github.com/repos/apache/parquet-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/apache/parquet-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/apache/parquet-cpp/tags","blobs_url":"https://api.github.com/repos/apache/parquet-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/parquet-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/parquet-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/parquet-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/parquet-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/parquet-cpp/languages","stargazers_url":"https://api.github.com/repos/apache/parquet-cpp/stargazers","contributors_url":"https://api.github.com/repos/apache/parquet-cpp/contributors","subscribers_url":"https://api.github.com/repos/apache/parquet-cpp/subscribers","subscription_url":"https://api.github.com/repos/apache/parquet-cpp/subscription","commits_url":"https://api.github.com/repos/apache/parquet-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/parquet-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/parquet-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/parquet-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/parquet-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/apache/parquet-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/parquet-cpp/merges","archive_url":"https://api.github.com/repos/apache/parquet-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/parquet-cpp/downloads","issues_url":"https://api.github.com/repos/apache/parquet-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/apache/parquet-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/parquet-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/parquet-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/parquet-cpp/labels{/name}","releases_url":"https://api.github.com/repos/apache/parquet-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/apache/parquet-cpp/deployments","created_at":"2014-06-10T07:00:07Z","updated_at":"2016-08-26T14:31:27Z","pushed_at":"2016-08-29T09:25:54Z","git_url":"git://github.com/apache/parquet-cpp.git","ssh_url":"git@github.com:apache/parquet-cpp.git","clone_url":"https://github.com/apache/parquet-cpp.git","svn_url":"https://github.com/apache/parquet-cpp","homepage":null,"size":1471,"stargazers_count":66,"watchers_count":66,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":37,"mirror_url":"git://git.apache.org/parquet-cpp.git","open_issues_count":5,"forks":37,"open_issues":5,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/parquet-cpp/pulls/143"},"html":{"href":"https://github.com/apache/parquet-cpp/pull/143"},"issue":{"href":"https://api.github.com/repos/apache/parquet-cpp/issues/143"},"comments":{"href":"https://api.github.com/repos/apache/parquet-cpp/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/parquet-cpp/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/parquet-cpp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/parquet-cpp/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/apache/parquet-cpp/statuses/ddbf37ef6f97e05b0fc8ddd2276b5f400edc785e"}}}}
{"actor":{"display_login":"xhochy"}}