cnauroth commented on code in PR #49833:
URL: https://github.com/apache/spark/pull/49833#discussion_r1955061841


##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryExecutionErrorsSuite.scala:
##########
@@ -1286,3 +1308,7 @@ class FakeFileSystemSetPermission extends LocalFileSystem 
{
 class FakeFileSystemNeverExists extends DebugFilesystem {
   override def exists(f: Path): Boolean = false
 }
+
+class FakeFileSystemListStatus extends LocalFileSystem {
+  override def listStatus(path: Path): Array[FileStatus] = null

Review Comment:
   Hello @fusheng9399 . I'm very curious to hear if you have actually 
encountered a `null` return in practice. `FileSystem` API docs state that it 
will not return `null`:
   
   
https://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#listStatus-org.apache.hadoop.fs.Path-
   
   The file system specification also states that implementors must not return 
`null`. See the "Null return" section here:
   
   
https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/filesystem/filesystem.html#FileStatus.5B.5D_listStatus.28Path_path.2C_PathFilter_filter.29
   
   There is a note about an edge case for file systems before Hadoop 3.0, but 
that shouldn't be relevant anymore.
   
   If you are actually seeing a `null` return, then that might indicate some 
kind of bug in the specific file system implementation. I would not expect 
Spark code (or any other callers of `FileSystem`) should need to handle a 
`null`.



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to