[SPARK-3713][SQL] Uses JSON to serialize DataType objects

This PR uses JSON instead of `toString` to serialize `DataType`s. The latter is not only hard to parse but also flaky in many cases.

Since we already write schema information to Parquet metadata in the old style, we have to reserve the old `DataType` parser and ensure downward compatibility. The old parser is now renamed to `CaseClassStringParser` and moved into `object DataType`.

@JoshRosen @davis Please help review PySpark related changes, thanks!
Thanks for the unhashable hint. I'd like to make the result JSON string as compact as possible, that's why all primitive types are serialized to a single string. Then I'll add a type check here.