Skip to content

Commit

Permalink
really really correct path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
marmbrus committed May 7, 2015
1 parent e56fd4a commit 258d000
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,14 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
hiveMetastoreJars
.split(File.pathSeparator)
.flatMap {
case path if path.endsWith("*") =>
val directory = new File(path.dropRight(1))
directory.listFiles.filter(_.getName.endsWith("jar"))
case path if new File(path).getName() == "*" =>
val files = new File(path).getParentFile().listFiles()
if (files == null) {
logWarning(s"Hive jar path '$path' does not exist.")
Nil
} else {
files.filter(_.getName().toLowerCase().endsWith(".jar"))
}
case path =>
new File(path) :: Nil
}
Expand Down

0 comments on commit 258d000

Please sign in to comment.