malinjawi commented on code in PR #12040:
URL: https://github.com/apache/gluten/pull/12040#discussion_r3243900591


##########
cpp/velox/compute/delta/DeltaDeletionVectorReader.h:
##########
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+/*
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * Licensed 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
+
+#include "velox/common/base/BitUtil.h"
+#include "velox/vector/ComplexVector.h"
+
+#include <memory>
+#include <optional>
+#include <roaring/roaring64map.hh>
+#include <string>
+#include <string_view>
+
+namespace gluten::delta {
+
+using namespace facebook::velox;
+
+/// Reads and manages Delta Lake deletion vectors for filtering deleted rows
+/// during table scans.
+///
+/// The JVM Delta side materializes the deletion vector and hands the 
serialized
+/// bitmap payload to native. This reader only deserializes that payload and
+/// applies row filtering during scan.
+///
+/// Usage example:
+/// @code
+///   auto reader = std::make_unique<DeltaDeletionVectorReader>();
+///   reader->loadSerializedDeletionVector(serializedPayload, 
expectedCardinality);
+///   if (reader->isRowDeleted(42)) {
+///     // Skip this row during scan
+///   }
+/// @endcode
+class DeltaDeletionVectorReader {
+ public:
+  DeltaDeletionVectorReader() = default;
+
+  /// Loads a deletion vector from an already decoded serialized Delta payload.
+  void loadSerializedDeletionVector(
+      std::string_view serializedPayload,
+      std::optional<uint64_t> expectedCardinality = std::nullopt);

Review Comment:
   Thanks @zhztheplayer!
   
   Updated the comment to explain `expectedCardinality` more directly:
   
   
https://github.com/apache/gluten/pull/12040/changes/BASE..e2aeaed2de9e03de82f61968faa83c51c5bf7c7e#diff-31100294214221e6cd8528fb9ae69506a6a3d6e45e4f24b126146b8db3d1863cR67-R76
   
   



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