Github user pwoody commented on a diff in the pull request:
https://github.com/apache/spark/pull/15835#discussion_r87717147
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala
---
@@ -703,6 +705,81 @@ class ParquetQuerySuite extends QueryTest with
ParquetTest with SharedSQLContext
}
}
}
+
+ test("SPARK-17059: Allow FileFormat to specify partition pruning
strategy") {
+ withSQLConf(ParquetOutputFormat.ENABLE_JOB_SUMMARY -> "true") {
+ withTempPath { path =>
+ spark.sparkContext.parallelize(Seq(1, 2, 3), 3)
+ .toDF("x").write.parquet(path.getCanonicalPath)
+
+ val zeroPartitions =
spark.read.parquet(path.getCanonicalPath).where("x = 0")
+ assert(zeroPartitions.rdd.partitions.length == 0)
+
+ val onePartition =
spark.read.parquet(path.getCanonicalPath).where("x = 1")
+ assert(onePartition.rdd.partitions.length == 1)
+ }
+ }
+ }
+
+ test("Do not filter out parquet file when missing in _metadata file") {
+ withSQLConf(ParquetOutputFormat.ENABLE_JOB_SUMMARY -> "true") {
+ withTempPath { path =>
+ spark.sparkContext.parallelize(Seq(1, 2, 3), 3)
+ .toDF("x").write.parquet(path.getCanonicalPath)
+ spark.sparkContext.parallelize(Seq(4))
+
.toDF("x").write.mode(SaveMode.Append).parquet(path.getCanonicalPath)
--- End diff --
Yeah - i've edited the test to clarify the intended behavior. i've also
change how we cache the metadata to reflect it as well.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]