Repository: kylin Updated Branches: refs/heads/2.0.x efc0a2c61 -> 044b34676
KYLIN-2603 support hllc in having push down Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/044b3467 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/044b3467 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/044b3467 Branch: refs/heads/2.0.x Commit: 044b34676a13435067491436ade2e627d12c821f Parents: efc0a2c Author: lidongsjtu <lid...@apache.org> Authored: Tue May 16 22:45:26 2017 +0800 Committer: lidongsjtu <lid...@apache.org> Committed: Tue May 16 22:45:35 2017 +0800 ---------------------------------------------------------------------- .../kylin/gridtable/GTAggregateScanner.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/044b3467/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java ---------------------------------------------------------------------- diff --git a/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java b/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java index 45a9148..02f1a6f 100644 --- a/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java +++ b/core-cube/src/main/java/org/apache/kylin/gridtable/GTAggregateScanner.java @@ -45,6 +45,9 @@ import org.apache.kylin.common.util.Pair; import org.apache.kylin.measure.BufferedMeasureCodec; import org.apache.kylin.measure.MeasureAggregator; import org.apache.kylin.measure.MeasureAggregators; +import org.apache.kylin.measure.bitmap.BitmapCounter; +import org.apache.kylin.measure.hllc.HLLCounter; +import org.apache.kylin.measure.percentile.PercentileCounter; import org.apache.kylin.metadata.filter.IFilterCodeSystem; import org.apache.kylin.metadata.filter.TupleFilter; import org.apache.kylin.metadata.model.TblColRef; @@ -413,10 +416,21 @@ public class GTAggregateScanner implements IGTScanner { // for the 'having clause', we only concern numbers and BigDecimal // we try to cache the o2, which should be a constant according to CompareTupleFilter.evaluate() + double n1; + if (o1 instanceof Number) { + n1 = ((Number) o1).doubleValue(); + } else if (o1 instanceof HLLCounter) { + n1 = ((HLLCounter) o1).getCountEstimate(); + } else if (o1 instanceof BitmapCounter) { + n1 = ((BitmapCounter) o1).getCount(); + } else if (o1 instanceof PercentileCounter) { + n1 = ((PercentileCounter) o1).getResultEstimate(); + } else { + throw new RuntimeException("Unknown datatype: value=" + o1 + ", class=" + o1.getClass()); + } - double n1 = ((Number) o1).doubleValue(); double n2 = (o2Cache == o2) ? n2Cache : Double.parseDouble((String) o2); - + if (o2Cache == null) { o2Cache = o2; n2Cache = n2;