malinjawi commented on code in PR #12198: URL: https://github.com/apache/gluten/pull/12198#discussion_r3373731865
########## backends-velox/src-delta40/main/scala/org/apache/gluten/extension/PreprocessDeltaScanWithDeletionVectors.scala: ########## @@ -0,0 +1,31 @@ +/* + * 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.gluten.extension + +import org.apache.spark.sql.SparkSession +import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan +import org.apache.spark.sql.catalyst.rules.Rule + +/** + * Delta 4 prepares DV scan metadata before Gluten offload, so this compatibility rule does not need + * to add backend-visible DV columns. + */ Review Comment: > @malinjawi does this mean we need to add new columns to table scan for Delta 3.3? if yes, can you help me understand the design here? @zhztheplayer No, we do NOT add new columns to the table scan output for Delta 3.3. The key insight is we're passing DV data as **file-level metadata**, not as scan output columns. The design works differently" **What Delta 3.3's `PreprocessTableWithDVs` does:** - Prepares Delta's internal scan metadata structures - Makes DV information accessible via Delta's file APIs - Does NOT inject `__delta_internal_*` columns into the scan output **What our code does:** - Extracts DV metadata from Delta's prepared file structures - Passes it to Velox as **per-file metadata** through `DeltaLocalFilesNode` → Substrait protobuf - Velox receives: `serializedDeletionVector`, `cardinality`, `rowIndexFilterType` for each file - No columns added to scan output - tests verify the plan contains no `__delta_internal_*` columns **Delta 4.0 difference:** - Delta 4.0 prepares this metadata earlier in its own pipeline - We just extract and forward it the same way - The no-op rule exists because Delta 4.0 doesn't need the explicit `preprocessTablesWithDVs()` call -- 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]
