Repository: spark
Updated Branches:
  refs/heads/branch-2.3 a8ee5706a -> 6dfb51557


[SPARK-23852][SQL] Add withSQLConf(...) to test case

## What changes were proposed in this pull request?

Add a `withSQLConf(...)` wrapper to force Parquet filter pushdown for a test 
that relies on it.

## How was this patch tested?

Test passes

Author: Henry Robinson <he...@apache.org>

Closes #21323 from henryr/spark-23582.

(cherry picked from commit 061e0084ce19c1384ba271a97a0aa1f87abe879d)
Signed-off-by: Marcelo Vanzin <van...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6dfb5155
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6dfb5155
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6dfb5155

Branch: refs/heads/branch-2.3
Commit: 6dfb515571b68a471509035287a46e431e48b73b
Parents: a8ee570
Author: Henry Robinson <he...@apache.org>
Authored: Mon May 14 14:35:08 2018 -0700
Committer: Marcelo Vanzin <van...@cloudera.com>
Committed: Mon May 14 14:35:17 2018 -0700

----------------------------------------------------------------------
 .../datasources/parquet/ParquetFilterSuite.scala      | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6dfb5155/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
----------------------------------------------------------------------
diff --git 
a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
 
b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
index 79891af..f8d04b5 100644
--- 
a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
+++ 
b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala
@@ -604,13 +604,15 @@ class ParquetFilterSuite extends QueryTest with 
ParquetTest with SharedSQLContex
   }
 
   test("SPARK-23852: Broken Parquet push-down for partially-written stats") {
-    // parquet-1217.parquet contains a single column with values -1, 0, 1, 2 
and null.
-    // The row-group statistics include null counts, but not min and max 
values, which
-    // triggers PARQUET-1217.
-    val df = readResourceParquetFile("test-data/parquet-1217.parquet")
+    withSQLConf(SQLConf.PARQUET_FILTER_PUSHDOWN_ENABLED.key -> "true") {
+      // parquet-1217.parquet contains a single column with values -1, 0, 1, 2 
and null.
+      // The row-group statistics include null counts, but not min and max 
values, which
+      // triggers PARQUET-1217.
+      val df = readResourceParquetFile("test-data/parquet-1217.parquet")
 
-    // Will return 0 rows if PARQUET-1217 is not fixed.
-    assert(df.where("col > 0").count() === 2)
+      // Will return 0 rows if PARQUET-1217 is not fixed.
+      assert(df.where("col > 0").count() === 2)
+    }
   }
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to