You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2015/05/15 09:29:36 UTC

incubator-kylin git commit: fix ci: after truncate decimal(KYLIN-766), value will no longer equals to resultValue

Repository: incubator-kylin
Updated Branches:
  refs/heads/0.8.0 5b507dd8b -> de06c4f48


fix ci: after truncate decimal(KYLIN-766), value will no longer equals to resultValue


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

Branch: refs/heads/0.8.0
Commit: de06c4f48ccddad886cde9620165b0d02cfa8749
Parents: 5b507dd
Author: honma <ho...@ebay.com>
Authored: Fri May 15 15:32:01 2015 +0800
Committer: honma <ho...@ebay.com>
Committed: Fri May 15 15:33:36 2015 +0800

----------------------------------------------------------------------
 .../job/hadoop/cube/NDCuboidMapperTest.java     | 33 +++++++++++++-------
 1 file changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/de06c4f4/job/src/test/java/org/apache/kylin/job/hadoop/cube/NDCuboidMapperTest.java
----------------------------------------------------------------------
diff --git a/job/src/test/java/org/apache/kylin/job/hadoop/cube/NDCuboidMapperTest.java b/job/src/test/java/org/apache/kylin/job/hadoop/cube/NDCuboidMapperTest.java
index 4e362b3..a6b0372 100644
--- a/job/src/test/java/org/apache/kylin/job/hadoop/cube/NDCuboidMapperTest.java
+++ b/job/src/test/java/org/apache/kylin/job/hadoop/cube/NDCuboidMapperTest.java
@@ -18,27 +18,29 @@
 
 package org.apache.kylin.job.hadoop.cube;
 
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
 import org.apache.commons.io.FileUtils;
-import org.apache.kylin.common.util.Bytes;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mrunit.mapreduce.MapReduceDriver;
 import org.apache.hadoop.mrunit.types.Pair;
+import org.apache.kylin.common.util.Bytes;
+import org.apache.kylin.common.util.LocalFileMetadataTestCase;
+import org.apache.kylin.job.constant.BatchConstants;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import org.apache.kylin.common.util.LocalFileMetadataTestCase;
-import org.apache.kylin.job.constant.BatchConstants;
+import javax.annotation.Nullable;
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+
+import static org.junit.Assert.*;
 
 /**
  * @author George Song (ysong1)
- * 
  */
 public class NDCuboidMapperTest extends LocalFileMetadataTestCase {
     MapReduceDriver<Text, Text, Text, Text, Text, Text> mapReduceDriver;
@@ -85,7 +87,16 @@ public class NDCuboidMapperTest extends LocalFileMetadataTestCase {
         byte[] resultValue = { 14, 7, 23, -16, 56, 92, 114, -80, 118, 14, 7, 23, -16, 56, 92, 114, -80, 118, 14, 7, 23, -16, 56, 92, 114, -80, 118, 1 };
         Pair<Text, Text> output1 = new Pair<Text, Text>(new Text(resultKey), new Text(resultValue));
 
-        assertTrue(result.contains(output1));
+        //As we will truncate decimal(KYLIN-766), value will no longer equals to resultValue
+        Collection<Text> keys = Collections2.transform(result, new Function<Pair<Text, Text>, Text>() {
+            @Nullable
+            @Override
+            public Text apply(Pair<Text, Text> input) {
+                return input.getFirst();
+            }
+        });
+        assertTrue(keys.contains(output1.getFirst()));
+        assertTrue(!result.contains(output1));
 
         long[] keySet = new long[result.size()];