-
- Downloads
[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 davies Please help review PySpark related changes, thanks! Author: Cheng Lian <lian.cs.zju@gmail.com> Closes #2563 from liancheng/datatype-to-json and squashes the following commits: fc92eb3 [Cheng Lian] Reverts debugging code, simplifies primitive type JSON representation 438c75f [Cheng Lian] Refactors PySpark DataType JSON SerDe per comments 6b6387b [Cheng Lian] Removes debugging code 6a3ee3a [Cheng Lian] Addresses per review comments dc158b5 [Cheng Lian] Addresses PEP8 issues 99ab4ee [Cheng Lian] Adds compatibility est case for Parquet type conversion a983a6c [Cheng Lian] Adds PySpark support f608c6e [Cheng Lian] De/serializes DataType objects from/to JSON
Showing
- python/pyspark/sql.py 75 additions, 78 deletionspython/pyspark/sql.py
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/WrapDynamic.scala 1 addition, 3 deletions...g/apache/spark/sql/catalyst/expressions/WrapDynamic.scala
- sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/types/dataTypes.scala 150 additions, 79 deletions...scala/org/apache/spark/sql/catalyst/types/dataTypes.scala
- sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala 4 additions, 5 deletions...core/src/main/scala/org/apache/spark/sql/SQLContext.scala
- sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTypes.scala 4 additions, 2 deletions...ain/scala/org/apache/spark/sql/parquet/ParquetTypes.scala
- sql/core/src/test/scala/org/apache/spark/sql/DataTypeSuite.scala 28 additions, 0 deletions...e/src/test/scala/org/apache/spark/sql/DataTypeSuite.scala
- sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetQuerySuite.scala 15 additions, 1 deletion...cala/org/apache/spark/sql/parquet/ParquetQuerySuite.scala
Loading
Please register or sign in to comment