carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [09/51] [abbrv] carbondata git commit: [CARBONDATA-1463] CompareTest should validate result size
Date Mon, 18 Sep 2017 10:01:28 GMT
[CARBONDATA-1463] CompareTest should validate result size

CompareTest for spark2.1 should only validate result size instead of result value, because
some test case include aggregation on double column which will give different result since
carbon records are sorted

This closes #1341


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/a5483e8c
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/a5483e8c
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/a5483e8c

Branch: refs/heads/branch-1.2
Commit: a5483e8c5a928fefaa130ac6ac5973ba459ae23f
Parents: 1852e13
Author: Jacky Li <jacky.likun@qq.com>
Authored: Fri Sep 8 22:06:41 2017 +0800
Committer: Ravindra Pesala <ravi.pesala@gmail.com>
Committed: Sat Sep 9 18:38:28 2017 +0530

----------------------------------------------------------------------
 .../main/scala/org/apache/carbondata/examples/CompareTest.scala | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/a5483e8c/examples/spark2/src/main/scala/org/apache/carbondata/examples/CompareTest.scala
----------------------------------------------------------------------
diff --git a/examples/spark2/src/main/scala/org/apache/carbondata/examples/CompareTest.scala
b/examples/spark2/src/main/scala/org/apache/carbondata/examples/CompareTest.scala
index ffc4b22..52ccd5f 100644
--- a/examples/spark2/src/main/scala/org/apache/carbondata/examples/CompareTest.scala
+++ b/examples/spark2/src/main/scala/org/apache/carbondata/examples/CompareTest.scala
@@ -320,7 +320,10 @@ object CompareTest {
 
   private def printErrorIfNotMatch(index: Int, table1: String, result1: Array[Row],
       table2: String, result2: Array[Row]): Unit = {
-    if (!result1.sameElements(result2)) {
+    // check result size instead of result value, because some test case include
+    // aggregation on double column which will give different result since carbon
+    // records are sorted
+    if (result1.length != result2.length) {
       val num = index + 1
       println(s"$table1 result for query $num: ")
       println(s"""${result1.mkString(",")}""")


Mime
View raw message