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 2019/01/31 10:15:27 UTC

[kylin] branch realtime-streaming updated: KYLIN-3800 Measure get incorrect result

This is an automated email from the ASF dual-hosted git repository.

magang pushed a commit to branch realtime-streaming
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/realtime-streaming by this push:
     new 99c8883  KYLIN-3800 Measure get incorrect result
99c8883 is described below

commit 99c88831595cbfad1728ecdfa3a0faecf1ee7a64
Author: chao long <wa...@qq.com>
AuthorDate: Thu Jan 31 17:40:03 2019 +0800

    KYLIN-3800 Measure get incorrect result
---
 .../kylin/stream/core/storage/columnar/ParsedStreamingCubeInfo.java | 6 ++++++
 .../kylin/stream/core/storage/columnar/SegmentMemoryStore.java      | 1 +
 2 files changed, 7 insertions(+)

diff --git a/stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/ParsedStreamingCubeInfo.java b/stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/ParsedStreamingCubeInfo.java
index 503278a..c730d0d 100644
--- a/stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/ParsedStreamingCubeInfo.java
+++ b/stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/ParsedStreamingCubeInfo.java
@@ -254,4 +254,10 @@ public class ParsedStreamingCubeInfo {
             return (int) (cuboidID ^ (cuboidID >>> 32));
         }
     }
+
+    public void resetAggrs() {
+        for (int i = 0; i < cubeDesc.getMeasures().size(); i++) {
+            measureIngesters[i].reset();
+        }
+    }
 }
diff --git a/stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/SegmentMemoryStore.java b/stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/SegmentMemoryStore.java
index 6fff1c6..1b0bb6a 100644
--- a/stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/SegmentMemoryStore.java
+++ b/stream-core/src/main/java/org/apache/kylin/stream/core/storage/columnar/SegmentMemoryStore.java
@@ -96,6 +96,7 @@ public class SegmentMemoryStore implements IStreamingGTSearcher {
             maxEventTime = eventTime;
         }
         List<String> row = event.getData();
+        parsedStreamingCubeInfo.resetAggrs();
         String[] basicCuboidDimensions = buildBasicCuboidKey(row);
         Object[] metricsValues = buildValue(row);
         aggregate(basicCuboidAggBufMap, basicCuboidDimensions, metricsValues);