gty404 commented on code in PR #62: URL: https://github.com/apache/iceberg-cpp/pull/62#discussion_r2033035547
########## src/iceberg/table_metadata.h: ########## @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#pragma once + +/// \file iceberg/table_metadata.h +/// Table metadata for Iceberg tables. + +#include <chrono> +#include <memory> +#include <string> +#include <unordered_map> +#include <vector> + +#include "iceberg/iceberg_export.h" +#include "iceberg/type_fwd.h" +#include "iceberg/util/formattable.h" + +namespace iceberg { + +using TimePointMs = + std::chrono::time_point<std::chrono::system_clock, std::chrono::milliseconds>; + +/// \brief Represents a snapshot log entry +struct ICEBERG_EXPORT SnapshotLogEntry : public util::Formattable { + /// The timestamp in milliseconds of the change + TimePointMs timestamp_ms; + /// ID of the snapshot + int64_t snapshot_id; + + std::string ToString() const override; +}; + +/// \brief Represents a metadata log entry +struct ICEBERG_EXPORT MetadataLogEntry : public util::Formattable { + /// The timestamp in milliseconds of the change + TimePointMs timestamp_ms; + /// Metadata file location + std::string file; + + std::string ToString() const override; +}; + +/// \brief Represents the metadata for an Iceberg table +/// +/// Note that it only contains table metadata from the spec. Compared to the Java +/// implementation, missing pieces including: 1) Map<Integer, +/// Schema|PartitionSpec|SortOrder> 2) List<MetadataUpdate> 3) Map<Long, Snapshot> 4) +/// Map<String, SnapshotRef> +/// +/// TODO(wgtmac): Implement Equals and ToString once SortOrder and Snapshot are +/// implemented. +struct ICEBERG_EXPORT TableMetadata { Review Comment: Do you need to mark some fields as optional? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org