weiting-chen commented on code in PR #13164:
URL: https://github.com/apache/gluten/pull/13164#discussion_r4150187665


##########
gluten-ut/spark42/src/test/scala/org/apache/spark/sql/connector/GlutenDataSourceV2EnhancedPartitionFilterSuite.scala:
##########
@@ -0,0 +1,23 @@
+/*
+ * 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.connector
+
+import org.apache.spark.sql.GlutenSQLTestsTrait
+
+class GlutenDataSourceV2EnhancedPartitionFilterSuite
+  extends DataSourceV2EnhancedPartitionFilterSuite
+  with GlutenSQLTestsTrait {}

Review Comment:
   **Adapt the two residual-filter assertions to mixed native execution**
   
   **Target Location:** 
`GlutenDataSourceV2EnhancedPartitionFilterSuite.scala:21-23`.
   
   **Problem:** Enabling this inherited suite with Gluten also enables two 
case9 tests whose final assertions require a Spark `FilterExec`. Their retained 
string-equality filters can correctly offload to `FilterExecTransformer`, which 
is not a subclass of `FilterExec`. The in-memory scan falls back, but scan 
fallback does not force the parent filter to fall back. With the workflow's 
ANSI=false and native filters enabled, correct mixed execution can therefore 
fail these vanilla-only plan assertions.
   
   **Evidence:**
   ```scala
   class GlutenDataSourceV2EnhancedPartitionFilterSuite
     extends DataSourceV2EnhancedPartitionFilterSuite
     with GlutenSQLTestsTrait {}
   ```
   The inherited ["case 
9"](https://github.com/apache/spark/blob/32f7299601108917fb01920a54e084595b7b3bf8/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2EnhancedPartitionFilterSuite.scala#L225-L246)
 and [nested identity 
case9](https://github.com/apache/spark/blob/32f7299601108917fb01920a54e084595b7b3bf8/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2EnhancedPartitionFilterSuite.scala#L286-L311)
 both use `executedPlan.exists(_.isInstanceOf[FilterExec])`. Gluten's filter 
transformer explicitly preserves the residual condition above a fallback child. 
This is source analysis, not an observed failure of these tests: the current 
group3 job stops at the parent's dependency error first.
   
   **Suggested Fix:** Prefer Gluten variants of these two tests that retain all 
answer/pushdown checks and accept the intended native residual filter as well 
as a vanilla fallback filter. If this wrapper is deliberately scoped to 
Spark-filter/plugin integration instead, make that scope explicit without 
disabling the plugin:
   ```scala
   import org.apache.spark.SparkConf
   
   class GlutenDataSourceV2EnhancedPartitionFilterSuite
     extends DataSourceV2EnhancedPartitionFilterSuite
     with GlutenSQLTestsTrait {
     override def sparkConf: SparkConf =
       super.sparkConf.set("spark.gluten.sql.columnar.filter", "false")
   }
   ```
   Run the suite with `SPARK_ANSI_SQL_MODE=false`; a pass with ANSI fallback 
enabled would not exercise the problematic mixed-plan path.



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