HuaHuaY commented on code in PR #344:
URL: https://github.com/apache/iceberg-cpp/pull/344#discussion_r2565686508


##########
src/iceberg/table_metadata.cc:
##########
@@ -162,6 +162,70 @@ bool operator==(const TableMetadata& lhs, const 
TableMetadata& rhs) {
          lhs.next_row_id == rhs.next_row_id;
 }
 
+// TableMetadataCache implementation
+
+Result<TableMetadataCache::SchemasMapRef> TableMetadataCache::GetSchemasById() 
const {
+  return schemas_map_.Get(metadata_);
+}
+
+Result<TableMetadataCache::PartitionSpecsMapRef>
+TableMetadataCache::GetPartitionSpecsById() const {
+  return partition_specs_map_.Get(metadata_);
+}
+
+Result<TableMetadataCache::SortOrdersMapRef> 
TableMetadataCache::GetSortOrdersById()
+    const {
+  return sort_orders_map_.Get(metadata_);
+}
+
+Result<TableMetadataCache::SnapshotsMapRef> 
TableMetadataCache::GetSnapshotsById() const {
+  return snapshot_map_.Get(metadata_);
+}
+
+Result<TableMetadataCache::SchemasMap> TableMetadataCache::InitSchemasMap(
+    const TableMetadata* metadata) {
+  SchemasMap schemas_map;
+  schemas_map.reserve(metadata->schemas.size());

Review Comment:
   Sad. `std::ranges::to` is supported by gcc 14. But we can use gcc 13 in ci.
   I test in my local environment. `vendoredarrow-src` can be compiled by gcc 
14 but can not be compiled by clang base on gcc 14. The difference is cmake 
will generate different compile flags. Clang will report that `atomic_load` is 
deprecated.
   Maybe we can upgrade gcc's version in ci from 13 to 14.



##########
src/iceberg/table_metadata.cc:
##########
@@ -162,6 +162,70 @@ bool operator==(const TableMetadata& lhs, const 
TableMetadata& rhs) {
          lhs.next_row_id == rhs.next_row_id;
 }
 
+// TableMetadataCache implementation
+
+Result<TableMetadataCache::SchemasMapRef> TableMetadataCache::GetSchemasById() 
const {
+  return schemas_map_.Get(metadata_);
+}
+
+Result<TableMetadataCache::PartitionSpecsMapRef>
+TableMetadataCache::GetPartitionSpecsById() const {
+  return partition_specs_map_.Get(metadata_);
+}
+
+Result<TableMetadataCache::SortOrdersMapRef> 
TableMetadataCache::GetSortOrdersById()
+    const {
+  return sort_orders_map_.Get(metadata_);
+}
+
+Result<TableMetadataCache::SnapshotsMapRef> 
TableMetadataCache::GetSnapshotsById() const {
+  return snapshot_map_.Get(metadata_);
+}
+
+Result<TableMetadataCache::SchemasMap> TableMetadataCache::InitSchemasMap(
+    const TableMetadata* metadata) {
+  SchemasMap schemas_map;
+  schemas_map.reserve(metadata->schemas.size());

Review Comment:
   Sad. `std::ranges::to` is supported by gcc 14. But we use gcc 13 in ci.
   I test in my local environment. `vendoredarrow-src` can be compiled by gcc 
14 but can not be compiled by clang base on gcc 14. The difference is cmake 
will generate different compile flags. Clang will report that `atomic_load` is 
deprecated.
   Maybe we can upgrade gcc's version in ci from 13 to 14.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to