-
- Downloads
[SPARK-6607][SQL] Check invalid characters for Parquet schema and show error messages
'(' and ')' are special characters used in Parquet schema for type annotation. When we run an aggregation query, we will obtain attribute name such as "MAX(a)". If we directly store the generated DataFrame as Parquet file, it causes failure when reading and parsing the stored schema string. Several methods can be adopted to solve this. This pr uses a simplest one to just replace attribute names before generating Parquet schema based on these attributes. Another possible method might be modifying all aggregation expression names from "func(column)" to "func[column]". Author: Liang-Chi Hsieh <viirya@gmail.com> Closes #5263 from viirya/parquet_aggregation_name and squashes the following commits: 2d70542 [Liang-Chi Hsieh] Address comment. 463dff4 [Liang-Chi Hsieh] Instead of replacing special chars, showing error message to user to suggest using Alias. 1de001d [Liang-Chi Hsieh] Replace special characters '(' and ')' of Parquet schema.
Showing
- sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTypes.scala 14 additions, 0 deletions...ain/scala/org/apache/spark/sql/parquet/ParquetTypes.scala
- sql/hive/src/test/scala/org/apache/spark/sql/hive/parquetSuites.scala 16 additions, 0 deletions.../test/scala/org/apache/spark/sql/hive/parquetSuites.scala
Please register or sign in to comment