You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/24 17:11:48 UTC

[GitHub] [spark] mridulm commented on a diff in pull request #38377: SPARK-40901. Unable to store Spark Driver logs with Absolute Hadoop based URI FS Path

mridulm commented on code in PR #38377:
URL: https://github.com/apache/spark/pull/38377#discussion_r1003551847


##########
core/src/test/scala/org/apache/spark/util/logging/DriverLoggerSuite.scala:
##########
@@ -59,15 +60,17 @@ class DriverLoggerSuite extends SparkFunSuite with LocalSparkContext {
 
     sc.stop()
     assert(!driverLogsDir.exists())
-    val dfsFile = FileUtils.getFile(sc.getConf.get(DRIVER_LOG_DFS_DIR).get,
-      app_id + DriverLogger.DRIVER_LOG_FILE_SUFFIX)
-    assert(dfsFile.exists())
-    assert(dfsFile.length() > 0)
+    val dfsFile = new Path(sc.getConf.get(DRIVER_LOG_DFS_DIR).get +
+      "/" + app_id + DriverLogger.DRIVER_LOG_FILE_SUFFIX)
+    val dfsFileStatus = dfsFile.getFileSystem(sc.hadoopConfiguration).getFileStatus(dfsFile)
+
+    assert(dfsFileStatus.isFile)
+    assert(dfsFileStatus.getLen > 0)
   }
 
   private def getSparkContext(): SparkContext = {
     val conf = new SparkConf()
-    conf.set(DRIVER_LOG_DFS_DIR, rootDfsDir.getAbsolutePath())
+    conf.set(DRIVER_LOG_DFS_DIR, "file://" + rootDfsDir.getAbsolutePath())
     conf.set(DRIVER_LOG_PERSISTTODFS, true)
     conf.set(SparkLauncher.SPARK_MASTER, "local")

Review Comment:
   Can we add a test specifically for this ? So that existing tests continue to check for local path ?



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org