Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/4115#discussion_r23256336
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/parquet/ParquetFilterSuite.scala
---
@@ -227,30 +234,30 @@ class ParquetFilterSuite extends QueryTest with
ParquetTest {
test("filter pushdown - string") {
withParquetRDD((1 to 4).map(i => Tuple1(i.toString))) { rdd =>
- checkFilterPushdown(rdd, '_1)('_1.isNull,
classOf[Eq[java.lang.String]])(Seq.empty[Row])
- checkFilterPushdown(rdd, '_1)('_1.isNotNull,
classOf[NotEq[java.lang.String]]) {
+ checkFilterPushdown1(rdd, '_1)('_1.isNull,
classOf[Eq[java.lang.String]])(Seq.empty[Row])
+ checkFilterPushdown1(rdd, '_1)('_1.isNotNull,
classOf[NotEq[java.lang.String]]) {
(1 to 4).map(i => Row.apply(i.toString))
}
- checkFilterPushdown(rdd, '_1)('_1 === "1", classOf[Eq[String]])("1")
- checkFilterPushdown(rdd, '_1)('_1 !== "1",
classOf[Operators.NotEq[String]]) {
+ checkFilterPushdown1(rdd, '_1)('_1 === "1",
classOf[Eq[String]])(Seq(Row("1")))
+ checkFilterPushdown1(rdd, '_1)('_1 !== "1",
classOf[Operators.NotEq[String]]) {
(2 to 4).map(i => Row.apply(i.toString))
}
- checkFilterPushdown(rdd, '_1)('_1 < "2", classOf[Lt
[java.lang.String]])("1")
- checkFilterPushdown(rdd, '_1)('_1 > "3", classOf[Gt
[java.lang.String]])("4")
- checkFilterPushdown(rdd, '_1)('_1 <= "1",
classOf[LtEq[java.lang.String]])("1")
- checkFilterPushdown(rdd, '_1)('_1 >= "4",
classOf[GtEq[java.lang.String]])("4")
+ checkFilterPushdown1(rdd, '_1)('_1 < "2", classOf[Lt
[java.lang.String]])(Seq(Row("1")))
+ checkFilterPushdown1(rdd, '_1)('_1 > "3", classOf[Gt
[java.lang.String]])(Seq(Row("4")))
+ checkFilterPushdown1(rdd, '_1)('_1 <= "1",
classOf[LtEq[java.lang.String]])(Seq(Row("1")))
+ checkFilterPushdown1(rdd, '_1)('_1 >= "4",
classOf[GtEq[java.lang.String]])(Seq(Row("4")))
- checkFilterPushdown(rdd, '_1)(Literal("1") === '_1, classOf[Eq
[java.lang.String]])("1")
- checkFilterPushdown(rdd, '_1)(Literal("2") > '_1, classOf[Lt
[java.lang.String]])("1")
- checkFilterPushdown(rdd, '_1)(Literal("3") < '_1, classOf[Gt
[java.lang.String]])("4")
- checkFilterPushdown(rdd, '_1)(Literal("1") >= '_1,
classOf[LtEq[java.lang.String]])("1")
- checkFilterPushdown(rdd, '_1)(Literal("4") <= '_1,
classOf[GtEq[java.lang.String]])("4")
+ checkFilterPushdown1(rdd, '_1)(Literal("1") === '_1, classOf[Eq
[java.lang.String]])(Seq(Row("1")))
+ checkFilterPushdown1(rdd, '_1)(Literal("2") > '_1, classOf[Lt
[java.lang.String]])(Seq(Row("1")))
+ checkFilterPushdown1(rdd, '_1)(Literal("3") < '_1, classOf[Gt
[java.lang.String]])(Seq(Row("4")))
+ checkFilterPushdown1(rdd, '_1)(Literal("1") >= '_1,
classOf[LtEq[java.lang.String]])(Seq(Row("1")))
+ checkFilterPushdown1(rdd, '_1)(Literal("4") <= '_1,
classOf[GtEq[java.lang.String]])(Seq(Row("4")))
- checkFilterPushdown(rdd, '_1)(!('_1 < "4"),
classOf[Operators.GtEq[java.lang.String]])("4")
- checkFilterPushdown(rdd, '_1)('_1 > "2" && '_1 < "4",
classOf[Operators.And])("3")
- checkFilterPushdown(rdd, '_1)('_1 < "2" || '_1 > "3",
classOf[Operators.Or]) {
+ checkFilterPushdown1(rdd, '_1)(!('_1 < "4"),
classOf[Operators.GtEq[java.lang.String]])(Seq(Row("4")))
+ checkFilterPushdown1(rdd, '_1)('_1 > "2" && '_1 < "4",
classOf[Operators.And])(Seq(Row("3")))
--- End diff --
But why did you make `checkFilterPushdown` only accept an `Int`? The
original version accepts `Any`.
---
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]