zhztheplayer commented on code in PR #12131:
URL: https://github.com/apache/gluten/pull/12131#discussion_r3316433034


##########
backends-velox/src-delta33/main/scala/org/apache/spark/sql/delta/stats/PrepareDeltaScan.scala:
##########
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.spark.sql.delta.stats
+
+import org.apache.spark.sql.SparkSession
+import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, 
V2WriteCommand}
+import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.delta.{DeltaTable, OptimisticTransaction, 
PreprocessTableWithDVs}
+import org.apache.spark.sql.delta.sources.DeltaSQLConf
+
+/** Shadow Delta's PrepareDeltaScan to inject backend-specific DV 
preprocessing. */
+class PrepareDeltaScan(protected val spark: SparkSession)

Review Comment:
   Thanks for the explanation. Is it replacing the same class from Delta? If so 
we'd avoid doing this in production. Have you checked the rule in the 
[PoC](https://github.com/apache/gluten/pull/10740)?



##########
gluten-substrait/src/main/resources/substrait/proto/substrait/algebra.proto:
##########
@@ -197,6 +197,18 @@ message ReadRel {
         repeated DeleteFile delete_files = 3;
       }
 
+      message DeltaReadOptions {
+        enum RowIndexFilterType {
+          KEEP_ALL = 0;
+          IF_CONTAINED = 1;
+          IF_NOT_CONTAINED = 2;
+        }
+        RowIndexFilterType row_index_filter_type = 1;
+        bool has_deletion_vector = 2;
+        uint64 deletion_vector_cardinality = 3;
+        uint32 deletion_vector_payload_index = 4;
+      }

Review Comment:
   In this PR, can we embed the serialized DV in the read options?
   
   And we can improve the perf with benchmark numbers in further development 
iterations.



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