当前位置: 首页>>代码示例>>Java>>正文


Java OLAPRel类代码示例

本文整理汇总了Java中org.apache.kylin.query.relnode.OLAPRel的典型用法代码示例。如果您正苦于以下问题:Java OLAPRel类的具体用法?Java OLAPRel怎么用?Java OLAPRel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OLAPRel类属于org.apache.kylin.query.relnode包,在下文中一共展示了OLAPRel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMatch

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
    final Sort sort = call.rel(0);
    if (sort.offset == null && sort.fetch == null) {
        return;
    }

    RelTraitSet origTraitSet = sort.getTraitSet();
    RelTraitSet traitSet = origTraitSet.replace(OLAPRel.CONVENTION).simplify();

    RelNode input = sort.getInput();
    if (!sort.getCollation().getFieldCollations().isEmpty()) {
        // Create a sort with the same sort key, but no offset or fetch.
        input = sort.copy(sort.getTraitSet(), input, sort.getCollation(), null, null);
    }
    RelNode x = convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION));
    call.transformTo(new OLAPLimitRel(sort.getCluster(), traitSet, x, sort.offset, sort.fetch));
}
 
开发者ID:apache,项目名称:kylin,代码行数:19,代码来源:OLAPLimitRule.java

示例2: convert

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
    LogicalAggregate agg = (LogicalAggregate) rel;

    // AVG() will be transformed into SUM()/COUNT() by AggregateReduceFunctionsRule.
    // Here only let the transformed plan pass.
    if (containsAvg(agg)) {
        return null;
    }

    RelTraitSet traitSet = agg.getTraitSet().replace(OLAPRel.CONVENTION);
    try {
        return new OLAPAggregateRel(agg.getCluster(), traitSet, convert(agg.getInput(), traitSet), agg.indicator, agg.getGroupSet(), agg.getGroupSets(), agg.getAggCallList());
    } catch (InvalidRelException e) {
        throw new IllegalStateException("Can't create OLAPAggregateRel!", e);
    }
}
 
开发者ID:apache,项目名称:kylin,代码行数:18,代码来源:OLAPAggregateRule.java

示例3: convert

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
    final Union union = (Union) rel;
    final RelTraitSet traitSet = union.getTraitSet().replace(OLAPRel.CONVENTION);
    final List<RelNode> inputs = union.getInputs();
    return new OLAPUnionRel(rel.getCluster(), traitSet, convertList(inputs, OLAPRel.CONVENTION), union.all);
}
 
开发者ID:apache,项目名称:kylin,代码行数:8,代码来源:OLAPUnionRule.java

示例4: convert

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
    final Sort sort = (Sort) rel;
    if (sort.offset != null || sort.fetch != null) {
        return null;
    }
    final RelTraitSet traitSet = sort.getTraitSet().replace(OLAPRel.CONVENTION);
    final RelNode input = sort.getInput();
    return new OLAPSortRel(rel.getCluster(), traitSet, convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION)), sort.getCollation(), sort.offset, sort.fetch);
}
 
开发者ID:apache,项目名称:kylin,代码行数:11,代码来源:OLAPSortRule.java

示例5: convert

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
    final Window window = (Window) rel;
    final RelTraitSet traitSet = window.getTraitSet().replace(OLAPRel.CONVENTION);
    final RelNode input = window.getInput();
    return new OLAPWindowRel(rel.getCluster(), traitSet, convert(input, OLAPRel.CONVENTION), window.constants, window.getRowType(), window.groups);
}
 
开发者ID:apache,项目名称:kylin,代码行数:8,代码来源:OLAPWindowRule.java

示例6: onMatch

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
    LogicalFilter filter = call.rel(0);

    RelTraitSet origTraitSet = filter.getTraitSet();
    RelTraitSet traitSet = origTraitSet.replace(OLAPRel.CONVENTION).simplify();

    OLAPFilterRel olapFilter = new OLAPFilterRel(filter.getCluster(), traitSet, convert(filter.getInput(), traitSet), filter.getCondition());
    call.transformTo(olapFilter);
}
 
开发者ID:apache,项目名称:kylin,代码行数:11,代码来源:OLAPFilterRule.java

示例7: onMatch

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
    LogicalProject project = call.rel(0);

    RelTraitSet origTraitSet = project.getTraitSet();
    RelTraitSet traitSet = origTraitSet.replace(OLAPRel.CONVENTION).simplify();

    OLAPProjectRel olapProj = new OLAPProjectRel(project.getCluster(), traitSet, //
            convert(project.getInput(), traitSet), project.getProjects(), project.getRowType());
    call.transformTo(olapProj);
}
 
开发者ID:apache,项目名称:kylin,代码行数:12,代码来源:OLAPProjectRule.java

示例8: convert

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
    final SortRel sort = (SortRel) rel;
    if (sort.offset != null || sort.fetch != null) {
        return null;
    }
    final RelTraitSet traitSet = sort.getTraitSet().replace(OLAPRel.CONVENTION);
    final RelNode input = sort.getChild();
    return new OLAPSortRel(rel.getCluster(), traitSet, convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION)), sort.getCollation(), sort.offset, sort.fetch);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:11,代码来源:OLAPSortRule.java

示例9: onMatch

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
    FilterRel filter = call.rel(0);

    RelTraitSet traitSet = filter.getTraitSet().replace(OLAPRel.CONVENTION);
    OLAPFilterRel olapFilter = new OLAPFilterRel(filter.getCluster(), traitSet, convert(filter.getChild(), traitSet), filter.getCondition());
    call.transformTo(olapFilter);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:9,代码来源:OLAPFilterRule.java

示例10: onMatch

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
    final SortRel sort = call.rel(0);
    if (sort.offset == null && sort.fetch == null) {
        return;
    }
    final RelTraitSet traitSet = sort.getTraitSet().replace(OLAPRel.CONVENTION);
    RelNode input = sort.getChild();
    if (!sort.getCollation().getFieldCollations().isEmpty()) {
        // Create a sort with the same sort key, but no offset or fetch.
        input = sort.copy(sort.getTraitSet(), input, sort.getCollation(), null, null);
    }
    RelNode x = convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION));
    call.transformTo(new OLAPLimitRel(sort.getCluster(), traitSet, x, sort.offset, sort.fetch));
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:16,代码来源:OLAPLimitRule.java

示例11: convert

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
    AggregateRel agg = (AggregateRel) rel;
    RelTraitSet traitSet = agg.getTraitSet().replace(OLAPRel.CONVENTION);
    try {
        return new OLAPAggregateRel(agg.getCluster(), traitSet, convert(agg.getChild(), traitSet), agg.getGroupSet(), agg.getAggCallList());
    } catch (InvalidRelException e) {
        throw new IllegalStateException("Can't create OLAPAggregateRel!", e);
    }
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:11,代码来源:OLAPAggregateRule.java

示例12: onMatch

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
    ProjectRel project = call.rel(0);

    RelTraitSet traitSet = project.getTraitSet().replace(OLAPRel.CONVENTION);
    OLAPProjectRel olapProj = new OLAPProjectRel(project.getCluster(), traitSet, //
            convert(project.getChild(), traitSet), project.getProjects(), project.getRowType(), project.getFlags());
    call.transformTo(olapProj);
}
 
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:10,代码来源:OLAPProjectRule.java

示例13: OLAPJoinRule

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
public OLAPJoinRule() {
    super(LogicalJoin.class, Convention.NONE, OLAPRel.CONVENTION, "OLAPJoinRule");
}
 
开发者ID:apache,项目名称:kylin,代码行数:4,代码来源:OLAPJoinRule.java

示例14: OLAPUnionRule

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
public OLAPUnionRule() {
    super(Union.class, Convention.NONE, OLAPRel.CONVENTION, "OLAPUnionRule");
}
 
开发者ID:apache,项目名称:kylin,代码行数:4,代码来源:OLAPUnionRule.java

示例15: OLAPSortRule

import org.apache.kylin.query.relnode.OLAPRel; //导入依赖的package包/类
public OLAPSortRule() {
    super(Sort.class, Convention.NONE, OLAPRel.CONVENTION, "OLAPSortRule");
}
 
开发者ID:apache,项目名称:kylin,代码行数:4,代码来源:OLAPSortRule.java


注:本文中的org.apache.kylin.query.relnode.OLAPRel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。