Repository: kylin Updated Branches: refs/heads/yang22-cdh5.7 014f72d83 -> 0c3177d3c (forced update)
KYLIN-2539 move FilterOptimizeTransformer to OLAPFilterRel Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/a943ddaa Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/a943ddaa Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/a943ddaa Branch: refs/heads/yang22-cdh5.7 Commit: a943ddaa25a9e93fc30f0b2681f3463af3dee357 Parents: c2cdce8 Author: Hongbin Ma <mahong...@apache.org> Authored: Tue Apr 11 14:35:38 2017 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Tue Apr 11 14:35:38 2017 +0800 ---------------------------------------------------------------------- .../java/org/apache/kylin/query/relnode/OLAPFilterRel.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/a943ddaa/query/src/main/java/org/apache/kylin/query/relnode/OLAPFilterRel.java ---------------------------------------------------------------------- diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPFilterRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPFilterRel.java index c826ff3..3306dbf 100755 --- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPFilterRel.java +++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPFilterRel.java @@ -78,12 +78,10 @@ public class OLAPFilterRel extends Filter implements OLAPRel { private static class TupleFilterVisitor extends RexVisitorImpl<TupleFilter> { private final ColumnRowType inputRowType; - private final OLAPContext context; - public TupleFilterVisitor(ColumnRowType inputRowType, OLAPContext context) { + public TupleFilterVisitor(ColumnRowType inputRowType) { super(true); this.inputRowType = inputRowType; - this.context = context; } @Override @@ -228,7 +226,6 @@ public class OLAPFilterRel extends Filter implements OLAPRel { @Override public TupleFilter visitInputRef(RexInputRef inputRef) { TblColRef column = inputRowType.getColumnByIndex(inputRef.getIndex()); - context.allColumns.add(column); ColumnTupleFilter filter = new ColumnTupleFilter(column); return filter; } @@ -318,12 +315,13 @@ public class OLAPFilterRel extends Filter implements OLAPRel { return; } - TupleFilterVisitor visitor = new TupleFilterVisitor(this.columnRowType, context); + TupleFilterVisitor visitor = new TupleFilterVisitor(this.columnRowType); context.filter = this.condition.accept(visitor); // optimize the filter, the optimization has to be segment-irrelevant new FilterOptimizeTransformer().transform(context.filter); context.filterColumns = collectColumns(context.filter); + context.allColumns.addAll(context.filterColumns); } private Set<TblColRef> collectColumns(TupleFilter filter) {