From b1bf5e98d82b76b088efce40938e5098e84c736a Mon Sep 17 00:00:00 2001 From: Chao Sun Date: Wed, 19 Aug 2020 22:47:05 -0700 Subject: [PATCH] Don't use null as BlockLocations --- .../main/scala/org/apache/spark/util/HadoopFSUtils.scala | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/util/HadoopFSUtils.scala b/core/src/main/scala/org/apache/spark/util/HadoopFSUtils.scala index db284d441ed0b..860912eb936f0 100644 --- a/core/src/main/scala/org/apache/spark/util/HadoopFSUtils.scala +++ b/core/src/main/scala/org/apache/spark/util/HadoopFSUtils.scala @@ -142,14 +142,7 @@ object HadoopFSUtils extends Logging { def next(): LocatedFileStatus = remoteIter.next def hasNext(): Boolean = remoteIter.hasNext }.toArray - case _ => - // We are ignoring locality, so we'll use a null locality - fs.listStatus(path).map{f => - f match { - case _: LocatedFileStatus => f - case _ => new LocatedFileStatus(f, null) - } - } + case _ => fs.listStatus(path) } } catch { // If we are listing a root path for SQL (e.g. a top level directory of a table), we need to