wangyum commented on a change in pull request #25014: [SPARK-28216][SQL][TEST]
Move getDataSize from StatisticsCollectionTestBase to SQLTestUtils
URL: https://github.com/apache/spark/pull/25014#discussion_r299478503
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala
##########
@@ -424,6 +425,14 @@ private[sql] trait SQLTestUtilsBase
protected def testFile(fileName: String): String = {
Thread.currentThread().getContextClassLoader.getResource(fileName).toString
}
+
+ /**
+ * Returns the size of the local directory except the metadata file and the
temporary file.
+ */
+ def getLocalDirSize(file: File): Long = {
+ assert(file.isDirectory)
+ file.listFiles.filter(f =>
DataSourceUtils.isDataFile(f.getName)).map(_.length).sum
Review comment:
It's `java.nio.file.Path`, not `org.apache.hadoop.fs.Path`:

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]