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


##########
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 @zhztheplayer. This is a Delta 3.3 compatibility shim around Delta's 
PrepareDeltaScan.
   
   It keeps Delta's normal scan preparation first, including stats skipping, 
metadata-query optimization, and transaction read tracking. After that, Gluten 
runs DV preprocessing so the scan exposes Delta's internal DV 
metadata/row-deleted column.
   
   Gluten needs that metadata to materialize the per-file DV payload for the 
native split. Later, once the native split has the payload, Gluten strips 
Spark's synthetic DV predicate/internal columns so Velox applies the DV filter 
natively and we do not filter twice.
   
   I can expand the comment to make this flow clear.
   



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