Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/4582#discussion_r24643956
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/json/JsonRDD.scala
---
@@ -306,6 +306,10 @@ private[sql] object JsonRDD extends Logging {
val parsed = mapper.readValue(record, classOf[Object]) match {
case map: java.util.Map[_, _] =>
scalafy(map).asInstanceOf[Map[String, Any]] :: Nil
case list: java.util.List[_] =>
scalafy(list).asInstanceOf[Seq[Map[String, Any]]]
+ case _ =>
+ sys.error(
+ s"Failed to parse record $record. Please make sure that " +
+ "every record in the dataset is a JSON object or an array
of JSON objects.")
--- End diff --
I'd say something like `each line of the file is a valid json object or
array` since its not obvious to non-hadoop people that this is how records
might be split.
---
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]