pan3793 commented on code in PR #7626:
URL: https://github.com/apache/kyuubi/pull/7626#discussion_r3763266855


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala:
##########
@@ -111,12 +115,16 @@ case class SparkSQLEngine(spark: SparkSession) extends 
Serverable("SparkSQLEngin
         Duration(60, TimeUnit.SECONDS))
     })
     try {
-      val fs = 
engineSavePath.getFileSystem(spark.sparkContext.hadoopConfiguration)
-      if (fs.exists(engineSavePath)) {
-        fs.delete(engineSavePath, true)
+      engineSavePath.foreach { path =>
+        val fs = path.getFileSystem(spark.sparkContext.hadoopConfiguration)
+        if (fs.exists(path)) {
+          fs.delete(path, true)
+        }
       }
     } catch {
-      case e: Throwable => error(s"Error cleaning engine result save path: 
$engineSavePath", e)
+      case e: Throwable =>
+        error(s"Error cleaning engine result save path:" +
+          s" ${engineSavePath.map(_.toString).getOrElse("<Empty>")}", e)

Review Comment:
   ```suggestion
           error("Error cleaning engine result save path: " +
             engineSavePath.map(_.toString).getOrElse("<Empty>"), e)
   ```



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