Zouxxyy opened a new pull request, #7065:
URL: https://github.com/apache/paimon/pull/7065

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... 
-->
   
   ### Purpose
   
   Fix for local execution of `mvn test -pl paimon-spark/paimon-spark-4.0 
-Pspark4 -DwildcardSuites='...'`
   
   ```text
   *** RUN ABORTED ***
   
java.util.ServiceConfigurationError:org.apache.spark.sql.paimon.shims.SparkShim:org.apache.spark.sql.paimon.shims.Spark3Shim
 Unable to get public no-arg constructor
   at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:586)
   at java.base/java.util.ServiceLoader .getConstructor(ServiceLoader.java:679)
   at 
java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1240)
   at 
java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
   at java.base/java.util.ServiceLoader$2.hasNext (ServiceLoader.java:1309)
   at java.base/java.util.ServiceLoader$3.hasNext (ServiceLoader.java:1393)
   at scala.collection.convert.JavaCollectionwrappers$JIteratorWrapper.hasNext 
(JavaCollectionwrappers.scala:46)
   at scala.collection.IterableOnceOps.size(IterableOnce.scala:980)
   at scala.collection.Iterable0nceOps.size$(IterableOnce.scala:975)
   at scala.collection.AbstractIterable.size(Iterable.scala:935)
   ```
   
   The most likely root cause is that `paimon-spark-ut_2.13` is being used by 
both `paimon-spark-3.x_2.13` and `paimon-spark-4.x_2.13`, and `paimon-spark-ut` 
itself depends on `paimon-sparkx-common`. This leads to dependency conflicts 
when running tests in the Spark 4 environment.
   
   If we have to choose one, I prefer publishing `paimon-spark-ut_2.13` built 
under the Spark4 profile. Therefore, this PR makes the following changes:
   
   - Publish `paimon-spark-ut_2.13` using the Spark 4 build profile.
   - Exclude transitive dependencies from the test dependency `paimon-spark-ut` 
— we only need its test classes, not its runtime dependencies.
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


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

Reply via email to