zhjwpku commented on code in PR #610:
URL: https://github.com/apache/iceberg-cpp/pull/610#discussion_r3027429748


##########
src/iceberg/data/delete_loader.h:
##########
@@ -0,0 +1,80 @@
+/*
+ * 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/data/delete_loader.h
+/// Loads position and equality delete files into in-memory indexes.
+
+#include <memory>
+#include <span>
+#include <string_view>
+
+#include "iceberg/iceberg_export.h"
+#include "iceberg/result.h"
+#include "iceberg/type_fwd.h"
+#include "iceberg/util/struct_like_set.h"
+
+namespace iceberg {
+
+/// \brief Loads delete files and constructs in-memory delete indexes.
+class ICEBERG_EXPORT DeleteLoader {
+ public:
+  /// \brief Create a DeleteLoader.
+  /// \param io FileIO instance for reading delete files
+  explicit DeleteLoader(std::shared_ptr<FileIO> io);
+
+  ~DeleteLoader();
+
+  /// \brief Load position deletes for a specific data file.
+  ///
+  /// Reads the given position delete files and returns a PositionDeleteIndex
+  /// containing only the positions that apply to the specified data file path.
+  /// Supports both regular position delete files and deletion vectors.
+  ///
+  /// \param delete_files Position delete files to load (must have
+  ///   content == Content::kPositionDeletes)
+  /// \param data_file_path Path of the data file to filter positions for
+  /// \return A PositionDeleteIndex with deleted positions for the data file
+  Result<PositionDeleteIndex> LoadPositionDeletes(
+      std::span<const std::shared_ptr<DataFile>> delete_files,
+      std::string_view data_file_path) const;
+
+  /// \brief Load equality deletes into an in-memory set.
+  ///
+  /// \param delete_files Equality delete files to load (must have
+  ///   content == Content::kEqualityDeletes)
+  /// \param equality_type The struct type describing the equality columns
+  /// \return A StructLikeSet containing the deleted rows
+  Result<std::unique_ptr<UncheckedStructLikeSet>> LoadEqualityDeletes(

Review Comment:
   Why LoadEqualityDeletes returns a unique ptr while LoadPositionDeletes 
returns a struct?



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