diff options
author | Liang-Chi Hsieh <viirya@gmail.com> | 2015-02-17 12:24:13 -0800 |
---|---|---|
committer | Michael Armbrust <michael@databricks.com> | 2015-02-17 12:24:13 -0800 |
commit | ac506b7c2846f656e03839bbd0e93827c7cc613e (patch) | |
tree | 890bc018ca958e62818a234a1a877cc8ec243fde /sql/core | |
parent | 4611de1cef7363bc71ec608560dfd866ae477747 (diff) | |
download | spark-ac506b7c2846f656e03839bbd0e93827c7cc613e.tar.gz spark-ac506b7c2846f656e03839bbd0e93827c7cc613e.tar.bz2 spark-ac506b7c2846f656e03839bbd0e93827c7cc613e.zip |
[Minor][SQL] Use same function to check path parameter in JSONRelation
Author: Liang-Chi Hsieh <viirya@gmail.com>
Closes #4649 from viirya/use_checkpath and squashes the following commits:
0f9a1a1 [Liang-Chi Hsieh] Use same function to check path parameter.
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/json/JSONRelation.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/json/JSONRelation.scala b/sql/core/src/main/scala/org/apache/spark/sql/json/JSONRelation.scala index 24848634de..3b68b7c275 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/json/JSONRelation.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/json/JSONRelation.scala @@ -37,7 +37,7 @@ private[sql] class DefaultSource override def createRelation( sqlContext: SQLContext, parameters: Map[String, String]): BaseRelation = { - val path = parameters.getOrElse("path", sys.error("Option 'path' not specified")) + val path = checkPath(parameters) val samplingRatio = parameters.get("samplingRatio").map(_.toDouble).getOrElse(1.0) JSONRelation(path, samplingRatio, None)(sqlContext) @@ -48,7 +48,7 @@ private[sql] class DefaultSource sqlContext: SQLContext, parameters: Map[String, String], schema: StructType): BaseRelation = { - val path = parameters.getOrElse("path", sys.error("Option 'path' not specified")) + val path = checkPath(parameters) val samplingRatio = parameters.get("samplingRatio").map(_.toDouble).getOrElse(1.0) JSONRelation(path, samplingRatio, Some(schema))(sqlContext) |