ala commented on code in PR #37214:
URL: https://github.com/apache/spark/pull/37214#discussion_r923366038
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileMetadataStructSuite.scala:
##########
@@ -564,4 +566,28 @@ class FileMetadataStructSuite extends QueryTest with
SharedSparkSession {
)
}
}
+
+ Seq(true, false).foreach { useVectorizedReader =>
+ val label = if (useVectorizedReader) "reading batches" else "reading rows"
+ test(s"SPARK-39806: metadata for a partitioned table ($label)") {
+ withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key ->
useVectorizedReader.toString) {
+ withTempPath { dir =>
+ // Store dynamically partitioned data.
+ Seq(1 -> 1).toDF("a", "b").write.format("parquet").partitionBy("b")
+ .save(dir.getAbsolutePath)
+
+ // Identify the data file and its metadata.
+ // We expect there to be exactly one subdirectory containing exactly
one parquet file.
+ val subdirectory = dir.listFiles().filter(_.isDirectory).head
Review Comment:
Ok, switched to `TestUtils.recursiveList` since it returns `File`s instead
of `String` and fits here a little bit better.
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileMetadataStructSuite.scala:
##########
@@ -564,4 +566,28 @@ class FileMetadataStructSuite extends QueryTest with
SharedSparkSession {
)
}
}
+
+ Seq(true, false).foreach { useVectorizedReader =>
+ val label = if (useVectorizedReader) "reading batches" else "reading rows"
+ test(s"SPARK-39806: metadata for a partitioned table ($label)") {
+ withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key ->
useVectorizedReader.toString) {
+ withTempPath { dir =>
+ // Store dynamically partitioned data.
+ Seq(1 -> 1).toDF("a", "b").write.format("parquet").partitionBy("b")
+ .save(dir.getAbsolutePath)
+
+ // Identify the data file and its metadata.
+ // We expect there to be exactly one subdirectory containing exactly
one parquet file.
+ val subdirectory = dir.listFiles().filter(_.isDirectory).head
Review Comment:
Ok, switched to `TestUtils.recursiveList` since it returns `File`s instead
of `String`s and fits here a little bit better.
--
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]