-
Notifications
You must be signed in to change notification settings - Fork 29k
SPARK-6245 [SQL] jsonRDD() of empty RDD results in exception #4971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #28450 has started for PR 4971 at commit
|
|
LGTM, thanks @srowen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a super nit, but I think typically we would just do Set.empty here or maybe Set.empty[(String, DataType)] if you really want to be explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No prob, will do, and if the tests succeed I'll merge.
|
Test build #28450 has finished for PR 4971 at commit
|
|
Test PASSed. |
|
Test build #28473 has started for PR 4971 at commit
|
|
Test build #28473 has finished for PR 4971 at commit
|
|
Test PASSed. |
Avoid `UnsupportedOperationException` from JsonRDD.inferSchema on empty RDD. Not sure if this is supposed to be an error (but a better one), but it seems like this case can come up if the input is down-sampled so much that nothing is sampled. Now stuff like this: ``` sqlContext.jsonRDD(sc.parallelize(List[String]())) ``` just results in ``` org.apache.spark.sql.DataFrame = [] ``` Author: Sean Owen <sowen@cloudera.com> Closes #4971 from srowen/SPARK-6245 and squashes the following commits: 3699964 [Sean Owen] Set() -> Set.empty 3c619e1 [Sean Owen] Avoid UnsupportedOperationException from JsonRDD.inferSchema on empty RDD
Avoid
UnsupportedOperationExceptionfrom JsonRDD.inferSchema on empty RDD.Not sure if this is supposed to be an error (but a better one), but it seems like this case can come up if the input is down-sampled so much that nothing is sampled.
Now stuff like this:
just results in