Github user drubbo commented on the pull request:
https://github.com/apache/spark/pull/6193#issuecomment-102952370
This for instance: in [SparkGIS](https://github.com/drubbo/SparkGIS) we're
adding support for geometry types that may be serialized in GeoJSON format, so
that we'd like to do the following inside a Spark application:
val schema = StructType(Seq(
StructField("id", IntegerType),
StructField("geo", GeometryType.Instance)
))
val rdd = sparkContext.parallelize(Seq(
"{\"id\":1,\"geo\":{\"type\":\"Point\",\"coordinates\":[1,1]}}",
"{\"id\":2,\"geo\":{\"type\":\"LineString\",\"coordinates\":[[12,13],[15,20]]}}"
))
val df = sqlContext.jsonRDD(rdd, schema) // here the schema is enforced
---
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]