@@ -147,7 +147,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
147147 spark.createDataFrame(data.map(x => ColA (Some (ColB (Some (ColC (Some (x)))))))),
148148 " a.b.c" , // two level nesting
149149 (x : Any ) => Row (Row (x)))
150- ).foreach { case (i, pushDownColName, resultFun) => withParquetDFfromDF (i) { implicit df =>
150+ ).foreach { case (i, pushDownColName, resultFun) => withParquetDataFrame (i) { implicit df =>
151151 val tsAttr = df(pushDownColName).expr
152152 checkFilterPredicate(tsAttr.isNull, classOf [Eq [_]], Seq .empty[Row ])
153153 checkFilterPredicate(tsAttr.isNotNull, classOf [NotEq [_]],
@@ -218,7 +218,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
218218 data.map(x => ColA (Option (ColB (Option (ColC (Option (x)))))))),
219219 " a.b.c" , // two level nesting
220220 (x : Any ) => Row (Row (x)))
221- ).foreach { case (i, pushDownColName, resultFun) => withParquetDFfromDF (i) { implicit df =>
221+ ).foreach { case (i, pushDownColName, resultFun) => withParquetDataFrame (i) { implicit df =>
222222 val booleanAttr = df(pushDownColName).expr
223223 checkFilterPredicate(booleanAttr.isNull, classOf [Eq [_]], Seq .empty[Row ])
224224 checkFilterPredicate(booleanAttr.isNotNull, classOf [NotEq [_]],
@@ -231,7 +231,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
231231 }}
232232
233233 test(" filter pushdown - tinyint" ) {
234- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (Option (i.toByte)))) { implicit df =>
234+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (Option (i.toByte) )))) { implicit df =>
235235 assert(df.schema.head.dataType === ByteType )
236236 checkFilterPredicate(' _1 .isNull, classOf [Eq [_]], Seq .empty[Row ])
237237 checkFilterPredicate(' _1 .isNotNull, classOf [NotEq [_]], (1 to 4 ).map(Row .apply(_)))
@@ -259,7 +259,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
259259 }
260260
261261 test(" filter pushdown - smallint" ) {
262- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (Option (i.toShort)))) { implicit df =>
262+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (Option (i.toShort) )))) { implicit df =>
263263 assert(df.schema.head.dataType === ShortType )
264264 checkFilterPredicate(' _1 .isNull, classOf [Eq [_]], Seq .empty[Row ])
265265 checkFilterPredicate(' _1 .isNotNull, classOf [NotEq [_]], (1 to 4 ).map(Row .apply(_)))
@@ -287,7 +287,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
287287 }
288288
289289 test(" filter pushdown - integer" ) {
290- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (Option (i)))) { implicit df =>
290+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (Option (i) )))) { implicit df =>
291291 checkFilterPredicate(' _1 .isNull, classOf [Eq [_]], Seq .empty[Row ])
292292 checkFilterPredicate(' _1 .isNotNull, classOf [NotEq [_]], (1 to 4 ).map(Row .apply(_)))
293293
@@ -313,7 +313,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
313313 }
314314
315315 test(" filter pushdown - long" ) {
316- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (Option (i.toLong)))) { implicit df =>
316+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (Option (i.toLong) )))) { implicit df =>
317317 checkFilterPredicate(' _1 .isNull, classOf [Eq [_]], Seq .empty[Row ])
318318 checkFilterPredicate(' _1 .isNotNull, classOf [NotEq [_]], (1 to 4 ).map(Row .apply(_)))
319319
@@ -339,7 +339,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
339339 }
340340
341341 test(" filter pushdown - float" ) {
342- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (Option (i.toFloat)))) { implicit df =>
342+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (Option (i.toFloat) )))) { implicit df =>
343343 checkFilterPredicate(' _1 .isNull, classOf [Eq [_]], Seq .empty[Row ])
344344 checkFilterPredicate(' _1 .isNotNull, classOf [NotEq [_]], (1 to 4 ).map(Row .apply(_)))
345345
@@ -365,7 +365,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
365365 }
366366
367367 test(" filter pushdown - double" ) {
368- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (Option (i.toDouble)))) { implicit df =>
368+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (Option (i.toDouble) )))) { implicit df =>
369369 checkFilterPredicate(' _1 .isNull, classOf [Eq [_]], Seq .empty[Row ])
370370 checkFilterPredicate(' _1 .isNotNull, classOf [NotEq [_]], (1 to 4 ).map(Row .apply(_)))
371371
@@ -391,7 +391,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
391391 }
392392
393393 test(" filter pushdown - string" ) {
394- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (i.toString))) { implicit df =>
394+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (i.toString) ))) { implicit df =>
395395 checkFilterPredicate(' _1 .isNull, classOf [Eq [_]], Seq .empty[Row ])
396396 checkFilterPredicate(
397397 ' _1 .isNotNull, classOf [NotEq [_]], (1 to 4 ).map(i => Row .apply(i.toString)))
@@ -423,7 +423,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
423423 def b : Array [Byte ] = int.toString.getBytes(StandardCharsets .UTF_8 )
424424 }
425425
426- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (i.b))) { implicit df =>
426+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (i.b) ))) { implicit df =>
427427 checkBinaryFilterPredicate(' _1 === 1 .b, classOf [Eq [_]], 1 .b)
428428 checkBinaryFilterPredicate(' _1 <=> 1 .b, classOf [Eq [_]], 1 .b)
429429
@@ -459,7 +459,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
459459
460460 val data = Seq (" 2018-03-18" , " 2018-03-19" , " 2018-03-20" , " 2018-03-21" )
461461
462- withParquetDFfromObjs( data.map(i => Tuple1 (i.date))) { implicit df =>
462+ withParquetDataFrame(toDF( data.map(i => Tuple1 (i.date) ))) { implicit df =>
463463 checkFilterPredicate(' _1 .isNull, classOf [Eq [_]], Seq .empty[Row ])
464464 checkFilterPredicate(' _1 .isNotNull, classOf [NotEq [_]], data.map(i => Row .apply(i.date)))
465465
@@ -518,7 +518,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
518518 // spark.sql.parquet.outputTimestampType = INT96 doesn't support pushdown
519519 withSQLConf(SQLConf .PARQUET_OUTPUT_TIMESTAMP_TYPE .key ->
520520 ParquetOutputTimestampType .INT96 .toString) {
521- withParquetDFfromObjs( millisData.map(i => Tuple1 (i))) { implicit df =>
521+ withParquetDataFrame(toDF( millisData.map(i => Tuple1 (i) ))) { implicit df =>
522522 val schema = new SparkToParquetSchemaConverter (conf).convert(df.schema)
523523 assertResult(None ) {
524524 createParquetFilters(schema).createFilter(sources.IsNull (" _1" ))
@@ -539,7 +539,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
539539 val rdd =
540540 spark.sparkContext.parallelize((1 to 4 ).map(i => Row (new java.math.BigDecimal (i))))
541541 val dataFrame = spark.createDataFrame(rdd, schema)
542- withParquetDFfromDF (dataFrame) { implicit df =>
542+ withParquetDataFrame (dataFrame) { implicit df =>
543543 assert(df.schema === schema)
544544 checkFilterPredicate(' a .isNull, classOf [Eq [_]], Seq .empty[Row ])
545545 checkFilterPredicate(' a .isNotNull, classOf [NotEq [_]], (1 to 4 ).map(Row .apply(_)))
@@ -1075,7 +1075,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
10751075 }
10761076
10771077 test(" SPARK-16371 Do not push down filters when inner name and outer name are the same" ) {
1078- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (Tuple1 (i)))) { implicit df =>
1078+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (Tuple1 (i) )))) { implicit df =>
10791079 // Here the schema becomes as below:
10801080 //
10811081 // root
@@ -1217,7 +1217,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
12171217 }
12181218
12191219 test(" filter pushdown - StringStartsWith" ) {
1220- withParquetDFfromObjs(( 1 to 4 ).map(i => Tuple1 (i + " str" + i))) { implicit df =>
1220+ withParquetDataFrame(toDF(( 1 to 4 ).map(i => Tuple1 (i + " str" + i) ))) { implicit df =>
12211221 checkFilterPredicate(
12221222 ' _1 .startsWith(" " ).asInstanceOf [Predicate ],
12231223 classOf [UserDefinedByInstance [_, _]],
@@ -1263,7 +1263,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared
12631263 }
12641264
12651265 // SPARK-28371: make sure filter is null-safe.
1266- withParquetDFfromObjs( Seq (Tuple1 [String ](null ))) { implicit df =>
1266+ withParquetDataFrame(toDF( Seq (Tuple1 [String ](null ) ))) { implicit df =>
12671267 checkFilterPredicate(
12681268 ' _1 .startsWith(" blah" ).asInstanceOf [Predicate ],
12691269 classOf [UserDefinedByInstance [_, _]],
0 commit comments