gatorsmile commented on a change in pull request #25399: [SPARK-28670][SQL] 
create function should thrown Exception if the resource is not found
URL: https://github.com/apache/spark/pull/25399#discussion_r366102477
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/functions.scala
 ##########
 @@ -74,6 +76,15 @@ case class CreateFunctionCommand(
   }
 
   override def run(sparkSession: SparkSession): Seq[Row] = {
+    // Checks if the given resources exist
+    val hadoopConf = sparkSession.sparkContext.hadoopConfiguration
+    val nonExistentResources = resources.filter { r =>
+      val path = new Path(r.uri)
+      !path.getFileSystem(hadoopConf).exists(path)
 
 Review comment:
   I am not sure whether this could cause a false alarm. For example, the 
security access exceptions. 
   
   You can check the impl of addJar or addFile.  

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to