Skip to content
Snippets Groups Projects
Commit 19c0faad authored by Michael Armbrust's avatar Michael Armbrust
Browse files

[HOTFIX][SQL] Fix parquet filter suite

Author: Michael Armbrust <michael@databricks.com>

Closes #3727 from marmbrus/parquetNotEq and squashes the following commits:

2157bfc [Michael Armbrust] Fix parquet filter suite
parent affc3f46
No related branches found
No related tags found
No related merge requests found
...@@ -87,14 +87,14 @@ class ParquetFilterSuite extends QueryTest with ParquetTest { ...@@ -87,14 +87,14 @@ class ParquetFilterSuite extends QueryTest with ParquetTest {
test("filter pushdown - boolean") { test("filter pushdown - boolean") {
withParquetRDD((true :: false :: Nil).map(Tuple1.apply)) { rdd => withParquetRDD((true :: false :: Nil).map(Tuple1.apply)) { rdd =>
checkFilterPushdown(rdd, '_1)('_1 === true, classOf[Eq[java.lang.Boolean]])(true) checkFilterPushdown(rdd, '_1)('_1 === true, classOf[Eq[java.lang.Boolean]])(true)
checkFilterPushdown(rdd, '_1)('_1 !== true, classOf[Operators.Not])(false) checkFilterPushdown(rdd, '_1)('_1 !== true, classOf[Operators.NotEq[java.lang.Boolean]])(false)
} }
} }
test("filter pushdown - integer") { test("filter pushdown - integer") {
withParquetRDD((1 to 4).map(Tuple1.apply)) { rdd => withParquetRDD((1 to 4).map(Tuple1.apply)) { rdd =>
checkFilterPushdown(rdd, '_1)('_1 === 1, classOf[Eq[Integer]])(1) checkFilterPushdown(rdd, '_1)('_1 === 1, classOf[Eq[Integer]])(1)
checkFilterPushdown(rdd, '_1)('_1 !== 1, classOf[Operators.Not]) { checkFilterPushdown(rdd, '_1)('_1 !== 1, classOf[Operators.NotEq[Integer]]) {
(2 to 4).map(Row.apply(_)) (2 to 4).map(Row.apply(_))
} }
...@@ -118,9 +118,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest { ...@@ -118,9 +118,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest {
} }
test("filter pushdown - long") { test("filter pushdown - long") {
withParquetRDD((1 to 4).map(i => Tuple1.apply(i.toLong))) { rdd => withParquetRDD((1 to 4).map(i => Tuple1(i.toLong))) { rdd =>
checkFilterPushdown(rdd, '_1)('_1 === 1, classOf[Eq[java.lang.Long]])(1) checkFilterPushdown(rdd, '_1)('_1 === 1, classOf[Eq[java.lang.Long]])(1)
checkFilterPushdown(rdd, '_1)('_1 !== 1, classOf[Operators.Not]) { checkFilterPushdown(rdd, '_1)('_1 !== 1, classOf[Operators.NotEq[java.lang.Long]]) {
(2 to 4).map(Row.apply(_)) (2 to 4).map(Row.apply(_))
} }
...@@ -144,9 +144,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest { ...@@ -144,9 +144,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest {
} }
test("filter pushdown - float") { test("filter pushdown - float") {
withParquetRDD((1 to 4).map(i => Tuple1.apply(i.toFloat))) { rdd => withParquetRDD((1 to 4).map(i => Tuple1(i.toFloat))) { rdd =>
checkFilterPushdown(rdd, '_1)('_1 === 1, classOf[Eq[java.lang.Float]])(1) checkFilterPushdown(rdd, '_1)('_1 === 1, classOf[Eq[java.lang.Float]])(1)
checkFilterPushdown(rdd, '_1)('_1 !== 1, classOf[Operators.Not]) { checkFilterPushdown(rdd, '_1)('_1 !== 1, classOf[Operators.NotEq[java.lang.Float]]) {
(2 to 4).map(Row.apply(_)) (2 to 4).map(Row.apply(_))
} }
...@@ -170,9 +170,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest { ...@@ -170,9 +170,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest {
} }
test("filter pushdown - double") { test("filter pushdown - double") {
withParquetRDD((1 to 4).map(i => Tuple1.apply(i.toDouble))) { rdd => withParquetRDD((1 to 4).map(i => Tuple1(i.toDouble))) { rdd =>
checkFilterPushdown(rdd, '_1)('_1 === 1, classOf[Eq[java.lang.Double]])(1) checkFilterPushdown(rdd, '_1)('_1 === 1, classOf[Eq[java.lang.Double]])(1)
checkFilterPushdown(rdd, '_1)('_1 !== 1, classOf[Operators.Not]) { checkFilterPushdown(rdd, '_1)('_1 !== 1, classOf[Operators.NotEq[java.lang.Double]]) {
(2 to 4).map(Row.apply(_)) (2 to 4).map(Row.apply(_))
} }
...@@ -196,9 +196,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest { ...@@ -196,9 +196,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest {
} }
test("filter pushdown - string") { test("filter pushdown - string") {
withParquetRDD((1 to 4).map(i => Tuple1.apply(i.toString))) { rdd => withParquetRDD((1 to 4).map(i => Tuple1(i.toString))) { rdd =>
checkFilterPushdown(rdd, '_1)('_1 === "1", classOf[Eq[String]])("1") checkFilterPushdown(rdd, '_1)('_1 === "1", classOf[Eq[String]])("1")
checkFilterPushdown(rdd, '_1)('_1 !== "1", classOf[Operators.Not]) { checkFilterPushdown(rdd, '_1)('_1 !== "1", classOf[Operators.NotEq[String]]) {
(2 to 4).map(i => Row.apply(i.toString)) (2 to 4).map(i => Row.apply(i.toString))
} }
...@@ -226,9 +226,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest { ...@@ -226,9 +226,9 @@ class ParquetFilterSuite extends QueryTest with ParquetTest {
def b: Array[Byte] = int.toString.getBytes("UTF-8") def b: Array[Byte] = int.toString.getBytes("UTF-8")
} }
withParquetRDD((1 to 4).map(i => Tuple1.apply(i.b))) { rdd => withParquetRDD((1 to 4).map(i => Tuple1(i.b))) { rdd =>
checkBinaryFilterPushdown(rdd, '_1)('_1 === 1.b, classOf[Eq[Array[Byte]]])(1.b) checkBinaryFilterPushdown(rdd, '_1)('_1 === 1.b, classOf[Eq[Array[Byte]]])(1.b)
checkBinaryFilterPushdown(rdd, '_1)('_1 !== 1.b, classOf[Operators.Not]) { checkBinaryFilterPushdown(rdd, '_1)('_1 !== 1.b, classOf[Operators.NotEq[Array[Byte]]]) {
(2 to 4).map(i => Row.apply(i.b)).toSeq (2 to 4).map(i => Row.apply(i.b)).toSeq
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment