Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/9142#discussion_r42218800
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/JSONRelation.scala
---
@@ -83,10 +83,13 @@ private[sql] class JSONRelation(
val job = new Job(sqlContext.sparkContext.hadoopConfiguration)
val conf = SparkHadoopUtil.get.getConfigurationFromJobContext(job)
- val paths = inputPaths.map(_.getPath)
+ val rddInputPaths = inputPaths.map(_.getPath)
- if (paths.nonEmpty) {
- FileInputFormat.setInputPaths(job, paths: _*)
+ if (rddInputPaths.nonEmpty) {
+ FileInputFormat.setInputPaths(job, rddInputPaths: _*)
+ } else {
+ throw new RuntimeException("Input paths do not exist or are empty
directories, "
--- End diff --
Use `require` to write this test. In general `RuntimeException` is not
something you should throw directly.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]