diff options
Diffstat (limited to 'sql/core/src/test')
-rw-r--r-- | sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala index 8a980a7eb5..31ebec096d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala @@ -1581,4 +1581,43 @@ class ParquetSchemaSuite extends ParquetSchemaTest { | } |} """.stripMargin) + + testSchemaClipping( + "int32 parquet field with byte schema field", + + parquetSchema = + """message root { + | optional int32 value; + |} + """.stripMargin, + + catalystSchema = + new StructType() + .add("value", ByteType, nullable = true), + + expectedSchema = + """message root { + | optional int32 value (INT_8); + |} + """.stripMargin) + + testSchemaClipping( + "int32 parquet field with short schema field", + + parquetSchema = + """message root { + | optional int32 value; + |} + """.stripMargin, + + catalystSchema = + new StructType() + .add("value", ShortType, nullable = true), + + expectedSchema = + """message root { + | optional int32 value (INT_16); + |} + """.stripMargin) + } |