andygrove opened a new pull request, #4118:
URL: https://github.com/apache/datafusion-comet/pull/4118

   ## Which issue does this PR close?
   
   Closes #4107.
   
   ## Rationale for this change
   
   When Spark 4.1 support landed (#4097), the new `spark/src/main/spark-4.1/`, 
`common/src/main/spark-4.1/`, and `spark/src/test/spark-4.1/` source trees were 
copied wholesale from the corresponding `spark-4.0` directories. The vast 
majority of those files are bitwise identical between the two profiles, so any 
future shim change has to be applied (and reviewed) twice.
   
   This mirrors the duplication problem we already solved for Spark 3.4/3.5 by 
introducing a shared `spark-3.x` source tree alongside the per-minor 
`spark-3.4` / `spark-3.5` overrides.
   
   ## What changes are included in this PR?
   
   Introduce shared `spark-4.x` source trees and move every file that is 
identical between `spark-4.0` and `spark-4.1` into them. The `spark-4.0` and 
`spark-4.1` trees are left containing only the genuinely version-specific files.
   
   Files moved to `spark/src/main/spark-4.x/` (10):
   - `org/apache/comet/shims/ShimCometBroadcastExchangeExec.scala`
   - `org/apache/comet/shims/ShimCometShuffleExchangeExec.scala`
   - `org/apache/comet/shims/ShimCometSparkSessionExtensions.scala`
   - `org/apache/comet/shims/ShimSQLConf.scala`
   - `org/apache/comet/shims/ShimSubqueryBroadcast.scala`
   - `org/apache/spark/comet/shims/ShimCometDriverPlugin.scala`
   - `org/apache/spark/sql/comet/shims/ShimCometScanExec.scala`
   - `org/apache/spark/sql/comet/shims/ShimCometShuffleWriteProcessor.scala`
   - `org/apache/spark/sql/comet/shims/ShimSparkErrorConverter.scala`
   - `org/apache/spark/sql/comet/shims/ShimStreamSourceAwareSparkPlan.scala`
   
   Files moved to `common/src/main/spark-4.x/` (5):
   - `org/apache/comet/shims/CometTypeShim.scala`
   - `org/apache/comet/shims/ShimBatchReader.scala`
   - `org/apache/comet/shims/ShimCometConf.scala`
   - `org/apache/comet/shims/ShimFileFormat.scala`
   - `org/apache/spark/sql/comet/shims/ShimTaskMetrics.scala`
   
   Files moved to `spark/src/test/spark-4.x/` (8):
   - `org/apache/comet/exec/CometShuffle4_0Suite.scala`
   - `org/apache/comet/iceberg/RESTCatalogHelper.scala`
   - `org/apache/comet/shims/ShimCometTPCHQuerySuite.scala`
   - `org/apache/iceberg/rest/RESTCatalogServlet.java`
   - `org/apache/spark/comet/shims/ShimTestUtils.scala`
   - `org/apache/spark/sql/CometToPrettyStringSuite.scala`
   - `org/apache/spark/sql/ShimCometTestBase.scala`
   - `org/apache/spark/sql/comet/shims/ShimCometTPCDSQuerySuite.scala`
   
   Files that remain version-specific:
   - 
`spark/src/main/spark-{4.0,4.1}/org/apache/comet/shims/CometExprShim.scala` 
(4.1 has different `BINARY_OUTPUT_STYLE` enum handling and `Sum.evalContext` 
API)
   - 
`spark/src/test/spark-{4.0,4.1}/org/apache/spark/sql/CometCollationSuite.scala`
   
   `pom.xml` profile changes: both `spark-4.0` and `spark-4.1` now set 
`shims.majorVerSrc=spark-4.x` and a real `shims.minorVerSrc` (`spark-4.0` / 
`spark-4.1`), exactly mirroring how the `spark-3.4` and `spark-3.5` profiles 
share `spark-3.x`. The build-helper-maven-plugin source-root wiring in 
`common/pom.xml` and `spark/pom.xml` already adds both major and minor source 
roots, so no plumbing changes are needed.
   
   ## How are these changes tested?
   
   - `./mvnw -Pspark-4.0 -DskipTests clean compile test-compile` succeeds.
   - `./mvnw -Pspark-4.1 -DskipTests clean compile test-compile` succeeds.
   - The Spark 3.4 / 3.5 profiles are not touched.
   - This is a pure file-move plus pom property change: `git diff --stat` 
against `apache/main` shows 1536 line deletions (the duplicate copies in 
`spark-4.1`) and 4 insertions (the four pom property edits).


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