LuciferYang commented on code in PR #12840:
URL: https://github.com/apache/gluten/pull/12840#discussion_r3834725542


##########
gluten-ut/spark34/src/test/scala/org/apache/spark/sql/GlutenImplicitsTest.scala:
##########
@@ -0,0 +1,134 @@
+/*
+ * 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
+
+import org.apache.gluten.config.GlutenConfig
+
+import org.apache.spark.SparkConf
+import org.apache.spark.sql.execution.GlutenImplicits._
+import org.apache.spark.sql.internal.SQLConf
+
+class GlutenImplicitsTest extends GlutenSQLTestsBaseTrait {

Review Comment:
   I tried that first and had to back out of it. Three things block the move 
today.
   
   `gluten-ut/test` cannot host this suite at all. `GlutenImplicitsTest extends 
GlutenSQLTestsBaseTrait`, which mixes in `GlutenTestsBaseTrait`; that trait 
overrides `test()` (`GlutenTestsBaseTrait.scala:59`) and routes every case 
through `shouldRun` (`:39`) into `BackendTestSettings.shouldRun`, and 
`BackendTestSettings.instance` reflectively loads 
`org.apache.gluten.utils.velox.VeloxTestSettings` / 
`...clickhouse.ClickHouseTestSettings` (`BackendTestSettings.scala:199-213`). 
Those two classes only exist in the per-version modules, and 
`gluten-ut/test/pom.xml` depends on `gluten-ut-common` and the backends but on 
no `gluten-ut-sparkXX`, so the lookup would throw `ClassNotFoundException`. 
This is also why none of the 11 suites currently in `gluten-ut/test` extends 
that trait family; they all sit on `WholeStageTransformerSuite`, 
`GlutenQueryTest` or `SparkFunSuite`.
   
   It is not backend independent either. ClickHouse reports different node 
counts for three of the six cases, so the CH settings carry 
`.excludeGlutenTest("fallbackSummary with shuffle")` and two more 
(`ClickHouseTestSettings.scala:1742-1745`), copied from spark33. A 
version-agnostic module has no mechanism to express that.
   
   And it turned out not to be version independent. The first CI round on this 
PR failed `fallbackSummary with data write command` on all four versions: 
spark33 expects one Gluten node, 3.4+ reports none, because since 3.4 the CTAS 
is executed as an `ExecutedCommandExec` that `collectFallbackNodes` walks past. 
A single shared copy would need an `isSparkVersionGE` branch in the test body, 
and removing that kind of branch is what the follow-up PRs of #12807 are for.
   
   The duplication you are pointing at is real, and I would rather fix it 
properly than paper over it here: making this suite independent of 
`BackendTestSettings` (and therefore of the per-version modules) is a change to 
shared test infrastructure, not something this migration should carry. Happy to 
file that as a separate issue if you agree with the split.



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