Github user jackylk commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1414#discussion_r145858506
--- Diff:
integration/spark-common/src/main/scala/org/apache/spark/sql/test/util/QueryTest.scala
---
@@ -58,6 +58,17 @@ class QueryTest extends PlanTest {
}
}
+ /**
+ * Runs the plan and counts the keyword in the answer
+ * @param df the [[DataFrame]] to be executed
+ * @param count expected count
+ * @param keyword keyword to search
+ */
+ def checkExistenceCount(df: DataFrame, count: Long, keyword: String):
Unit = {
+ val outputs = df.collect().map(_.mkString).mkString
+ assert(outputs.sliding(keyword.length).count(_ == keyword) == count)
--- End diff --
Can you use assertEqual so that console will show the correct answer if the
testcase failed
---