HeartSaVioR commented on a change in pull request #26768: 
[SPARK-30141][SQL][TESTS] Fix QueryTest.checkAnswer usage
URL: https://github.com/apache/spark/pull/26768#discussion_r354650628
 
 

 ##########
 File path: sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
 ##########
 @@ -2030,7 +2030,10 @@ class SQLQuerySuite extends QueryTest with 
SharedSparkSession {
       def verifyCallCount(df: DataFrame, expectedResult: Row, expectedCount: 
Int): Unit = {
         countAcc.setValue(0)
         QueryTest.checkAnswer(
-          df, Seq(expectedResult), checkToRDD = false /* avoid duplicate exec 
*/)
+          df, Seq(expectedResult), checkToRDD = false /* avoid duplicate exec 
*/) match {
 
 Review comment:
   Why not adding a new method in `QueryTest` object to let it call `fail` 
instead? The pattern is simply duplicated across changes, and even 
`QueryTest.checkAnswer` (protected method), which warrants enough reason to 
have another method.
   
   e.g. `checkAnswer(df: DataFrame, expectedAnswer: java.util.List[Row]): 
String`

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

Reply via email to