We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e56fd4a commit 258d000Copy full SHA for 258d000
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala
@@ -188,9 +188,14 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
188
hiveMetastoreJars
189
.split(File.pathSeparator)
190
.flatMap {
191
- case path if path.endsWith("*") =>
192
- val directory = new File(path.dropRight(1))
193
- directory.listFiles.filter(_.getName.endsWith("jar"))
+ case path if new File(path).getName() == "*" =>
+ val files = new File(path).getParentFile().listFiles()
+ if (files == null) {
194
+ logWarning(s"Hive jar path '$path' does not exist.")
195
+ Nil
196
+ } else {
197
+ files.filter(_.getName().toLowerCase().endsWith(".jar"))
198
+ }
199
case path =>
200
new File(path) :: Nil
201
}
0 commit comments