Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
address comment
  • Loading branch information
Ngone51 committed Dec 2, 2019
commit e889cda5b1ef4eb28dbdc276926a2318be3df531
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,15 @@ abstract class PartitioningAwareFileIndex(
if (!fs.isDirectory(userDefinedBasePath)) {
throw new IllegalArgumentException(s"Option '$BASE_PATH_PARAM' must be a directory")
}
def qualifiedPath(path: Path): String = fs.makeQualified(path).toString

val qualifiedBasePath = qualifiedPath(userDefinedBasePath)
val qualifiedBasePath = fs.makeQualified(userDefinedBasePath)
val qualifiedBasePathStr = qualifiedBasePath.toString
rootPaths
.find(p => !qualifiedPath(p).startsWith(qualifiedBasePath))
.find(!fs.makeQualified(_).toString.startsWith(qualifiedBasePathStr))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review note: I've inlined the qualified() function into find() clause.

.foreach { rp =>
throw new IllegalArgumentException(
s"Wrong basePath $userDefinedBasePath for the root path: $rp")
}
Set(new Path(qualifiedBasePath))
Set(qualifiedBasePath)

case None =>
rootPaths.map { path =>
Expand Down