提交 cad29a40 编写于 作者: H hyukjinkwon 提交者: Michael Armbrust

[SPARK-13728][SQL] Fix ORC PPD test so that pushed filters can be checked.

## What changes were proposed in this pull request?
https://issues.apache.org/jira/browse/SPARK-13728

https://github.com/apache/spark/pull/11509 makes the output only single ORC file.
It was 10 files but this PR writes only single file. So, this could not skip stripes in ORC by the pushed down filters.
So, this PR simply repartitions data into 10 so that the test could pass.
## How was this patch tested?

unittest and `./dev/run_tests` for code style test.

Author: hyukjinkwon <gurwls223@gmail.com>

Closes #11593 from HyukjinKwon/SPARK-13728.
上级 23369c3b
......@@ -348,7 +348,7 @@ class OrcQuerySuite extends QueryTest with BeforeAndAfterAll with OrcTest {
}
}
ignore("SPARK-10623 Enable ORC PPD") {
test("SPARK-10623 Enable ORC PPD") {
withTempPath { dir =>
withSQLConf(SQLConf.ORC_FILTER_PUSHDOWN_ENABLED.key -> "true") {
import testImplicits._
......@@ -363,7 +363,9 @@ class OrcQuerySuite extends QueryTest with BeforeAndAfterAll with OrcTest {
val nullValue: Option[String] = None
(maybeInt, nullValue)
}
createDataFrame(data).toDF("a", "b").write.orc(path)
// It needs to repartition data so that we can have several ORC files
// in order to skip stripes in ORC.
createDataFrame(data).toDF("a", "b").repartition(10).write.orc(path)
val df = sqlContext.read.orc(path)
def checkPredicate(pred: Column, answer: Seq[Row]): Unit = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册