You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/03/17 06:23:18 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #40449: [SPARK-42791][SQL] Create a new golden file test framework for analysis

cloud-fan commented on code in PR #40449:
URL: https://github.com/apache/spark/pull/40449#discussion_r1139817260


##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala:
##########
@@ -108,4 +126,23 @@ trait SQLQueryTestHelper {
         (emptySchema, Seq(e.getClass.getName, e.getMessage))
     }
   }
+
+  protected def splitWithSemicolon(seq: Seq[String]): Array[String] = {
+    seq.mkString("\n").split("(?<=[^\\\\]);")
+  }
+
+  protected def splitCommentsAndCodes(input: String): (Array[String], Array[String]) =
+    input.split("\n").partition { line =>
+      val newLine = line.trim
+      newLine.startsWith("--") && !newLine.startsWith("--QUERY-DELIMITER")
+    }
+
+  /** Returns all the files (not directories) in a directory, recursively. */
+  protected def listFilesRecursively(path: File): Seq[File] = {

Review Comment:
   I assume these 3 method are just copied from the existing code



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org