when i use spark2.0 read json file like:
Dataset<Row> logDF = spark.read().json(path);
logDF.show();
but it failed :
16/08/04 15:35:05 ERROR yarn.ApplicationMaster: User class threw exception: java.lang.RuntimeException: Multiple sources found for json (org.apache.spark.sql.execution.datasources.json.JsonFileFormat, org.apache.spark.sql.execution.datasources.json.DefaultSource), please specify the fully qualified class name.
java.lang.RuntimeException: Multiple sources found for json (org.apache.spark.sql.execution.datasources.json.JsonFileFormat, org.apache.spark.sql.execution.datasources.json.DefaultSource), please specify the fully qualified class name.
at scala.sys.package$.error(package.scala:27)
at org.apache.spark.sql.execution.datasources.DataSource.lookupDataSource(DataSource.scala:167)
at org.apache.spark.sql.execution.datasources.DataSource.providingClass$lzycompute(DataSource.scala:78)
at org.apache.spark.sql.execution.datasources.DataSource.providingClass(DataSource.scala:78)
at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:310)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:149)
at org.apache.spark.sql.DataFrameReader.json(DataFrameReader.scala:287)
at org.apache.spark.sql.DataFrameReader.json(DataFrameReader.scala:249)
when I use spark 1.6 it was run correct. the error tell specify the fully qualified class name , but i cant find which class conflict.
thank you very much!
spark.read().format("json").json(path);. I was facing something similar for csv and found github.com/databricks/spark-csv/issues/367