wgtmac commented on code in PR #74:
URL: https://github.com/apache/iceberg-cpp/pull/74#discussion_r2042433243


##########
src/iceberg/snapshot.h:
##########
@@ -54,13 +77,35 @@ struct ICEBERG_EXPORT SnapshotRef {
     /// of the snapshot reference to keep while expiring snapshots. Defaults 
to table
     /// property history.expire.max-ref-age-ms. The main branch never expires.
     std::optional<int64_t> max_ref_age_ms;
+
+    /// \brief Compare two branches for equality.
+    friend bool operator==(const Branch& lhs, const Branch& rhs) {

Review Comment:
   Aren't these trivial `operator==` and `operator!=` generated by compilers?



##########
src/iceberg/snapshot.h:
##########
@@ -39,6 +40,28 @@ enum class SnapshotRefType {
   kTag,
 };
 
+/// \brief Get the relative snapshot reference type name
+ICEBERG_EXPORT constexpr std::string_view SnapshotRefTypeToString(
+    SnapshotRefType type) noexcept {
+  switch (type) {
+    case SnapshotRefType::kBranch:
+      return "branch";
+    case SnapshotRefType::kTag:
+      return "tag";
+    default:
+      return "invalid";

Review Comment:
   ```suggestion
   ```



##########
src/iceberg/json_internal.cc:
##########
@@ -70,6 +72,53 @@ constexpr std::string_view kValueRequired = "value-required";
 
 constexpr std::string_view kFieldId = "field-id";
 constexpr std::string_view kSpecId = "spec-id";
+constexpr std::string_view kSnapshotId = "snapshot-id";
+constexpr std::string_view kParentSnapshotId = "parent-snapshot-id";
+constexpr std::string_view kSequenceNumber = "sequence-number";
+constexpr std::string_view kTimestampMs = "timestamp-ms";
+constexpr std::string_view kManifestList = "manifest-list";
+constexpr std::string_view kSummary = "summary";
+constexpr std::string_view kMinSnapshotsToKeep = "min-snapshots-to-keep";
+constexpr std::string_view kMaxSnapshotAgeMs = "max-snapshot-age-ms";
+constexpr std::string_view kMaxRefAgeMs = "max-ref-age-ms";
+
+const std::unordered_set<std::string_view> kValidSnapshotSummaryFields = {
+    SnapshotSummaryFields::kOperation,
+    SnapshotSummaryFields::kAddedDataFiles,
+    SnapshotSummaryFields::kDeletedDataFiles,
+    SnapshotSummaryFields::kTotalDataFiles,
+    SnapshotSummaryFields::kAddedDeleteFiles,
+    SnapshotSummaryFields::kAddedEqDeleteFiles,
+    SnapshotSummaryFields::kRemovedEqDeleteFiles,
+    SnapshotSummaryFields::kAddedPosDeleteFiles,
+    SnapshotSummaryFields::kRemovedPosDeleteFiles,
+    SnapshotSummaryFields::kAddedDVs,
+    SnapshotSummaryFields::kRemovedDVs,
+    SnapshotSummaryFields::kRemovedDeleteFiles,
+    SnapshotSummaryFields::kTotalDeleteFiles,
+    SnapshotSummaryFields::kAddedRecords,
+    SnapshotSummaryFields::kDeletedRecords,
+    SnapshotSummaryFields::kTotalRecords,
+    SnapshotSummaryFields::kAddedFileSize,
+    SnapshotSummaryFields::kRemovedFileSize,
+    SnapshotSummaryFields::kTotalFileSize,
+    SnapshotSummaryFields::kAddedPosDeletes,
+    SnapshotSummaryFields::kRemovedPosDeletes,
+    SnapshotSummaryFields::kTotalPosDeletes,
+    SnapshotSummaryFields::kAddedEqDeletes,
+    SnapshotSummaryFields::kRemovedEqDeletes,
+    SnapshotSummaryFields::kTotalEqDeletes,
+    SnapshotSummaryFields::kDeletedDuplicatedFiles,
+    SnapshotSummaryFields::kChangedPartitionCountProp,
+    SnapshotSummaryFields::kWAPID,
+    SnapshotSummaryFields::kPublishedWAPID,
+    SnapshotSummaryFields::kSourceSnapshotID,

Review Comment:
   ```suggestion
       SnapshotSummaryFields::kWAPId,
       SnapshotSummaryFields::kPublishedWAPId,
       SnapshotSummaryFields::kSourceSnapshotId,
   ```



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

Reply via email to