@@ -327,8 +327,8 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
327327
328328 val carsCopy = spark.read.xml(copyFilePath.toString)
329329
330- assert(carsCopy.count === cars.count)
331- assert(carsCopy.collect.map(_.toString).toSet === cars.collect.map(_.toString).toSet)
330+ assert(carsCopy.count() === cars.count() )
331+ assert(carsCopy.collect() .map(_.toString).toSet === cars.collect() .map(_.toString).toSet)
332332 }
333333
334334 test(" DSL save with gzip compression codec by shorten name" ) {
@@ -345,8 +345,8 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
345345
346346 val carsCopy = spark.read.xml(copyFilePath.toString)
347347
348- assert(carsCopy.count === cars.count)
349- assert(carsCopy.collect.map(_.toString).toSet === cars.collect.map(_.toString).toSet)
348+ assert(carsCopy.count() === cars.count() )
349+ assert(carsCopy.collect() .map(_.toString).toSet === cars.collect() .map(_.toString).toSet)
350350 }
351351
352352 test(" DSL save" ) {
@@ -362,8 +362,8 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
362362 val booksCopy = spark.read
363363 .option(" rowTag" , " book" )
364364 .xml(copyFilePath.toString)
365- assert(booksCopy.count === books.count)
366- assert(booksCopy.collect.map(_.toString).toSet === books.collect.map(_.toString).toSet)
365+ assert(booksCopy.count() === books.count() )
366+ assert(booksCopy.collect() .map(_.toString).toSet === books.collect() .map(_.toString).toSet)
367367 }
368368
369369 test(" DSL save with nullValue and treatEmptyValuesAsNulls" ) {
@@ -381,8 +381,8 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
381381 .option(" treatEmptyValuesAsNulls" , " true" )
382382 .xml(copyFilePath.toString)
383383
384- assert(booksCopy.count === books.count)
385- assert(booksCopy.collect.map(_.toString).toSet === books.collect.map(_.toString).toSet)
384+ assert(booksCopy.count() === books.count() )
385+ assert(booksCopy.collect() .map(_.toString).toSet === books.collect() .map(_.toString).toSet)
386386 }
387387
388388 test(" Write values properly as given to valueTag even if it starts with attributePrefix" ) {
@@ -408,8 +408,8 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
408408 .option(" rowTag" , " book" )
409409 .xml(copyFilePath.toString)
410410
411- assert(booksCopy.count === books.count)
412- assert(booksCopy.collect.map(_.toString).toSet === books.collect.map(_.toString).toSet)
411+ assert(booksCopy.count() === books.count() )
412+ assert(booksCopy.collect() .map(_.toString).toSet === books.collect() .map(_.toString).toSet)
413413 }
414414
415415 test(" DSL save dataframe not read from a XML file" ) {
@@ -429,7 +429,7 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
429429 field(" item" , ArrayType (StringType ))))
430430 val dfCopy = spark.read.xml(copyFilePath.toString)
431431
432- assert(dfCopy.count === df.count)
432+ assert(dfCopy.count() === df.count() )
433433 assert(dfCopy.schema === schemaCopy)
434434 }
435435
@@ -582,7 +582,7 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
582582 field(" title" ))
583583
584584 assert(resultsOne.schema === schemaOne)
585- assert(resultsOne.count === 12 )
585+ assert(resultsOne.count() === 12 )
586586
587587 // Explicitly set
588588 val attributePrefix = " @#"
@@ -602,7 +602,7 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
602602 field(" title" ))
603603
604604 assert(resultsTwo.schema === schemaTwo)
605- assert(resultsTwo.count === 12 )
605+ assert(resultsTwo.count() === 12 )
606606 }
607607
608608 test(" DSL test schema (excluding tags) inferred correctly" ) {
@@ -752,7 +752,7 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
752752 assert(result(0 ) === Row (111 , 222 ))
753753 }
754754
755- private [this ] def testNextedElementFromFile (xmlFile : String ) = {
755+ private [this ] def testNextedElementFromFile (xmlFile : String ): Unit = {
756756 val lines = getLines(Paths .get(xmlFile)).toList
757757 val firstExpected = lines(2 ).trim
758758 val lastExpected = lines(3 ).trim
@@ -962,8 +962,8 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
962962 val booksCopy = spark.read
963963 .option(" rowTag" , " book" )
964964 .xml(copyFilePath.toString)
965- assert(booksCopy.count === books.count)
966- assert(booksCopy.collect.map(_.toString).toSet === books.collect.map(_.toString).toSet)
965+ assert(booksCopy.count() === books.count() )
966+ assert(booksCopy.collect() .map(_.toString).toSet === books.collect() .map(_.toString).toSet)
967967 }
968968
969969 test(" DSL test nulls out invalid values when set to permissive and given explicit schema" ) {
@@ -1213,7 +1213,7 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
12131213 df.write.option(" rootTag" , " root foo='bar' bing=\" baz\" " ).xml(xmlPath.toString)
12141214
12151215 val xmlFile =
1216- Files .list(xmlPath).iterator.asScala.filter(_.getFileName.toString.startsWith(" part-" )).next
1216+ Files .list(xmlPath).iterator.asScala.filter(_.getFileName.toString.startsWith(" part-" )).next()
12171217 val firstLine = getLines(xmlFile).head
12181218 assert(firstLine === " <root foo=\" bar\" bing=\" baz\" >" )
12191219 }
@@ -1378,7 +1378,7 @@ final class XmlSuite extends AnyFunSuite with BeforeAndAfterAll {
13781378 private def getLines (path : Path ): Seq [String ] = {
13791379 val source = Source .fromFile(path.toFile)
13801380 try {
1381- source.getLines.toList
1381+ source.getLines() .toList
13821382 } finally {
13831383 source.close()
13841384 }
0 commit comments