I have a parquet file, and the MessageType recorded in the file is:
Use to read the file. Spark will throw an exception when converting Parquet MessageType to Spark SQL StructType:
Use to read the file, spark returns the correct result .
According to the parquet project document (https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#maps), the mapKey in the parquet format does not need to be a primitive type.
Note: This parquet file is not written by spark, because spark will write additional sparkSchema string information in the parquet file. When Spark reads, it will directly use the additional sparkSchema information in the file instead of converting Parquet MessageType to Spark SQL StructType.
I will submit a PR later.