dongjoon-hyun commented on a change in pull request #34199:
URL: https://github.com/apache/spark/pull/34199#discussion_r740756207



##########
File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala
##########
@@ -114,7 +130,66 @@ abstract class ParquetSchemaTest extends ParquetTest with 
SharedSparkSession {
       sqlSchema,
       parquetSchema,
       binaryAsString,
-      int96AsTimestamp)
+      int96AsTimestamp,
+      expectedParquetColumn = expectedParquetColumn)
+  }
+
+  protected def compareParquetColumn(actual: ParquetColumn, expected: 
ParquetColumn): Unit = {
+    assert(actual.sparkType == expected.sparkType, "sparkType mismatch: " +
+        s"actual = ${actual.sparkType}, expected = ${expected.sparkType}")
+    assert(actual.descriptor === expected.descriptor, "column descriptor 
mismatch: " +
+        s"actual = ${actual.descriptor}, expected = ${expected.descriptor})")
+    // Parquet ColumnDescriptor equals only compare path so we'll need to 
compare other fields
+    // explicitly here
+    if (actual.descriptor.isDefined && expected.descriptor.isDefined) {
+      val actualDesc = actual.descriptor.get
+      val expectedDesc = expected.descriptor.get
+      assert(actualDesc.getMaxRepetitionLevel == 
expectedDesc.getMaxRepetitionLevel)

Review comment:
       BTW, just a question. Is this a bug of Apache Parquet? I'm curious why 
Apache Parquet only compares `path`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to