From acbfd038ab88188291d9318c75ad783385724338 Mon Sep 17 00:00:00 2001 From: Kousuke Saruta Date: Sun, 3 Apr 2022 00:52:52 -0700 Subject: [PATCH] [MINOR][CORE] Change the log level to WARN for the message which is shown in case users attemp to add a JAR twice ### What changes were proposed in this pull request? This PR changes the log level to WARN for the message which is shown in case users attempt to add a JAR twice by `sc.addJar`. ### Why are the changes needed? It's for consistency. `sc.addFile` and `sc.addArchive` show the message as warning in such case. ### Does this PR introduce _any_ user-facing change? Yes. The message will appear even when the log level of the logger is WARN. But I don't think it affects the behavior. ### How was this patch tested? Manually confirmed like as follows: ``` sc.addJar("file:////tmp/test.jar") sc.addJar("file:////tmp/test.jar") 22/02/09 00:56:28 WARN SparkContext: The JAR file:////tmp/test.jar at spark://192.168.1.204:44533/jars/test.jar has been added already. Overwriting of added jar is not supported in the current version. ``` Closes #35443 from sarutak/add-jar-warn. Authored-by: Kousuke Saruta Signed-off-by: Dongjoon Hyun --- core/src/main/scala/org/apache/spark/SparkContext.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index 02c58d2a9b4f2..7257371256d97 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -2023,7 +2023,7 @@ class SparkContext(config: SparkConf) extends Logging { } if (existed.nonEmpty) { val jarMessage = if (scheme != "ivy") "JAR" else "dependency jars of Ivy URI" - logInfo(s"The $jarMessage $path at ${existed.mkString(",")} has been added already." + + logWarning(s"The $jarMessage $path at ${existed.mkString(",")} has been added already." + " Overwriting of added jar is not supported in the current version.") } }