SPARK-4228 SchemaRDD to JSON

Here's a simple fix for SchemaRDD to JSON.
Could you put some simple tests (also will be examples in docs) here?