Github user dongjoon-hyun commented on a diff in the pull request:
https://github.com/apache/spark/pull/20504#discussion_r166135925
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala ---
@@ -250,11 +257,20 @@ class SQLQueryTestSuite extends QueryTest with
SharedSQLContext {
}
private def listTestCases(): Seq[TestCase] = {
- listFilesRecursively(new File(inputFilePath)).map { file =>
+ listFilesRecursively(new File(inputFilePath)).flatMap { file =>
val resultFile = file.getAbsolutePath.replace(inputFilePath,
goldenFilePath) + ".out"
val absPath = file.getAbsolutePath
val testCaseName =
absPath.stripPrefix(inputFilePath).stripPrefix(File.separator)
- TestCase(testCaseName, absPath, resultFile)
+ if (testCaseName.contains("typeCoercion")) {
+ TypeCoercionMode.values.map(_.toString).map { mode =>
+ val fileNameWithMode = mode + File.separator + file.getName
+ val newTestCaseName = testCaseName.replace(file.getName,
fileNameWithMode)
+ val newResultFile = resultFile.replace(file.getName,
fileNameWithMode)
--- End diff --
It seems that we have some duplication now. For example,
```
$ diff
./sql/core/src/test/resources/sql-tests/results/typeCoercion/default/binaryComparison.sql.out
./sql/core/src/test/resources/sql-tests/results/typeCoercion/hive/binaryComparison.sql.out
```
I'm wondering if we can reuse the original answer file for `hive` if those
files are identical. BTW, how many files are different for both modes?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]