shardulm94 commented on a change in pull request #31741:
URL: https://github.com/apache/spark/pull/31741#discussion_r588362435
##########
File path: core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
##########
@@ -1203,9 +1203,9 @@ private[spark] object SparkSubmitUtils {
def resolveDependencyPaths(
artifacts: Array[AnyRef],
cacheDirectory: File): Seq[String] = {
- artifacts.map { artifactInfo =>
- val artifact = artifactInfo.asInstanceOf[Artifact].getModuleRevisionId
- val extraAttrs = artifactInfo.asInstanceOf[Artifact].getExtraAttributes
+ artifacts.map(_.asInstanceOf[Artifact]).filter(_.getExt == "jar").map {
artifactInfo =>
Review comment:
Added this logging
`21/03/05 06:40:48 INFO SparkSubmitUtils: Skipping non-jar dependency
org.apache.curator#apache-curator;2.7.1!apache-curator.pom`
##########
File path:
core/src/test/scala/org/apache/spark/deploy/SparkSubmitUtilsSuite.scala
##########
@@ -277,4 +279,35 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with
BeforeAndAfterAll {
.exists(r.findFirstIn(_).isDefined), "resolution files should be
cleaned")
}
}
+
+ test("SPARK-34624: should ignore non-jar dependencies") {
+ val main = MavenCoordinate("my.great.lib", "mylib", "0.1")
+ val dep = "my.great.dep:mydep:0.5"
+
+ IvyTestUtils.withRepository(main, Some(dep), None) { repo =>
+ // IvyTestUtils.withRepository does not have an easy way for creating
non-jar dependencies
+ // So we let it create the jar dependency in `mylib-0.1.pom`, and then
modify the pom
+ // to change the type of the transitive to `pom`
+ val mainPom = new
File(URI.create(repo).resolve("my/great/lib/mylib/0.1/mylib-0.1.pom"))
+ val source = Source.fromFile(mainPom)
+ val modifiedPom = new File(s"$tempIvyPath/modified-mylib-0.1.pom")
+ val sink = new PrintWriter(modifiedPom)
+ source.getLines()
+ .map(l => if (l.trim == "<artifactId>mydep</artifactId>")
s"$l<type>pom</type>" else l)
+ // scalastyle:off println
+ .foreach(sink.println)
+ // scalastyle:on println
+ source.close()
+ sink.close()
+ modifiedPom.renameTo(mainPom)
Review comment:
Done! Thanks for the suggestion!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]