请选择 进入手机版 | 继续访问电脑版
  • 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Window类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: onMatch

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final Window window = call.rel(0);
  final RelNode input = call.rel(1);
  final RelTraitSet traits = window.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
  final RelNode convertedInput = convert(input, traits);
  call.transformTo(
      new DrillWindowRel(
          window.getCluster(),
          traits,
          convertedInput,
          window.constants,
          window.getRowType(),
          window.groups));
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:16,代码来源:DrillWindowRule.java


示例2: getCollation

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
/**
 * Create a RelCollation that has partition-by as the leading keys followed by order-by keys
 * @param window The window specification
 * @return a RelCollation with {partition-by keys, order-by keys}
 */
private RelCollation getCollation(Window.Group window) {
  List<RelFieldCollation> fields = Lists.newArrayList();
  for (int group : BitSets.toIter(window.keys)) {
    fields.add(new RelFieldCollation(group));
  }

  for (RelFieldCollation field : window.orderKeys.getFieldCollations()) {
    fields.add(field);
  }

  return RelCollationImpl.of(fields);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:18,代码来源:WindowPrule.java


示例3: getDistributionFields

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
private List<DrillDistributionTrait.DistributionField> getDistributionFields(Window.Group window) {
  List<DrillDistributionTrait.DistributionField> groupByFields = Lists.newArrayList();
  for (int group : BitSets.toIter(window.keys)) {
    DrillDistributionTrait.DistributionField field = new DrillDistributionTrait.DistributionField(group);
    groupByFields.add(field);
  }

  return groupByFields;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:10,代码来源:WindowPrule.java


示例4: getDistributionFieldsFromCollation

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
private List<DistributionField> getDistributionFieldsFromCollation(Window.Group window) {
  List<DistributionField> distFields = Lists.newArrayList();

  for (RelFieldCollation relField : window.collation().getFieldCollations()) {
    DistributionField field = new DistributionField(relField.getFieldIndex());
    distFields.add(field);
  }

  return distFields;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:11,代码来源:WindowPrule.java


示例5: onMatch

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final Window window = call.rel(0);
  final RelNode input = call.rel(1);
  final RelTraitSet traits = window.getTraitSet().plus(Rel.LOGICAL);
  final RelNode convertedInput = convert(input, traits.simplify());
  call.transformTo(
      new WindowRel(
          window.getCluster(),
          traits,
          convertedInput,
          window.constants,
          window.getRowType(),
          window.groups));
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:16,代码来源:WindowRule.java


示例6: getCollation

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
/**
 * Create a RelCollation that has partition-by as the leading keys followed by order-by keys
 * @param window The window specification
 * @return a RelCollation with {partition-by keys, order-by keys}
 */
private RelCollation getCollation(Window.Group window) {
  List<RelFieldCollation> fields = Lists.newArrayList();
  for (int group : BitSets.toIter(window.keys)) {
    fields.add(new RelFieldCollation(group));
  }

  fields.addAll(window.orderKeys.getFieldCollations());

  return RelCollations.of(fields);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:16,代码来源:WindowPrule.java


示例7: getDistributionFields

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
private List<DistributionTrait.DistributionField> getDistributionFields(Window.Group window) {
  List<DistributionTrait.DistributionField> groupByFields = Lists.newArrayList();
  for (int group : BitSets.toIter(window.keys)) {
    DistributionTrait.DistributionField field = new DistributionTrait.DistributionField(group);
    groupByFields.add(field);
  }

  return groupByFields;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:10,代码来源:WindowPrule.java


示例8: matches

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
@Override
public boolean matches(RelOptRuleCall call) {
  final DrillWindowRel oldWinRel = (DrillWindowRel) call.rels[0];
  for(Window.Group group : oldWinRel.groups) {
    for(Window.RexWinAggCall rexWinAggCall : group.aggCalls) {
      if(isConversionToSumZeroNeeded(rexWinAggCall.getOperator(), rexWinAggCall.getType())) {
        return true;
      }
    }
  }
  return false;
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:13,代码来源:DrillReduceAggregatesRule.java


示例9: traverse

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
public final T traverse(RelNode n) throws Exception {
  List<T> inputStreams = new ArrayList<>();
  for (RelNode input : n.getInputs()) {
    inputStreams.add(traverse(input));
  }

  if (n instanceof Aggregate) {
    return visitAggregate((Aggregate) n, inputStreams);
  } else if (n instanceof Calc) {
    return visitCalc((Calc) n, inputStreams);
  } else if (n instanceof Collect) {
    return visitCollect((Collect) n, inputStreams);
  } else if (n instanceof Correlate) {
    return visitCorrelate((Correlate) n, inputStreams);
  } else if (n instanceof Delta) {
    return visitDelta((Delta) n, inputStreams);
  } else if (n instanceof Exchange) {
    return visitExchange((Exchange) n, inputStreams);
  } else if (n instanceof Project) {
    return visitProject((Project) n, inputStreams);
  } else if (n instanceof Filter) {
    return visitFilter((Filter) n, inputStreams);
  } else if (n instanceof Sample) {
    return visitSample((Sample) n, inputStreams);
  } else if (n instanceof Sort) {
    return visitSort((Sort) n, inputStreams);
  } else if (n instanceof TableModify) {
    return visitTableModify((TableModify) n, inputStreams);
  } else if (n instanceof TableScan) {
    return visitTableScan((TableScan) n, inputStreams);
  } else if (n instanceof Uncollect) {
    return visitUncollect((Uncollect) n, inputStreams);
  } else if (n instanceof Window) {
    return visitWindow((Window) n, inputStreams);
  } else if (n instanceof Join) {
    return visitJoin((Join) n, inputStreams);
  } else {
    return defaultValue(n, inputStreams);
  }
}
 
开发者ID:hortonworks,项目名称:streamline,代码行数:41,代码来源:PostOrderRelNodeVisitor.java


示例10: convert

import org.apache.calcite.rel.core.Window; //导入依赖的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


示例11: DrillWindowRule

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
private DrillWindowRule() {
  super(RelOptHelper.some(Window.class, Convention.NONE, RelOptHelper.any(RelNode.class)), "DrillWindowRule");
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:4,代码来源:DrillWindowRule.java


示例12: WindowRule

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
private WindowRule() {
  super(RelOptHelper.some(Window.class, Convention.NONE, RelOptHelper.any(RelNode.class)), "WindowRule");
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:4,代码来源:WindowRule.java


示例13: onMatch

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final DrillWindowRel oldWinRel = (DrillWindowRel) call.rels[0];
  final ImmutableList.Builder<Window.Group> builder = ImmutableList.builder();

  for(Window.Group group : oldWinRel.groups) {
    final List<Window.RexWinAggCall> aggCalls = Lists.newArrayList();
    for(Window.RexWinAggCall rexWinAggCall : group.aggCalls) {
      if(isConversionToSumZeroNeeded(rexWinAggCall.getOperator(), rexWinAggCall.getType())) {
        final RelDataType argType = rexWinAggCall.getType();
        final RelDataType sumType = oldWinRel.getCluster().getTypeFactory()
            .createTypeWithNullability(argType, argType.isNullable());
        final SqlAggFunction sumZeroAgg = new DrillCalciteSqlAggFunctionWrapper(
            new SqlSumEmptyIsZeroAggFunction(), sumType);
        final Window.RexWinAggCall sumZeroCall =
            new Window.RexWinAggCall(
                sumZeroAgg,
                sumType,
                rexWinAggCall.operands,
                rexWinAggCall.ordinal);
        aggCalls.add(sumZeroCall);
      } else {
        aggCalls.add(rexWinAggCall);
      }
    }

    final Window.Group newGroup = new Window.Group(
        group.keys,
        group.isRows,
        group.lowerBound,
        group.upperBound,
        group.orderKeys,
        aggCalls);
    builder.add(newGroup);
  }

  call.transformTo(new DrillWindowRel(
      oldWinRel.getCluster(),
      oldWinRel.getTraitSet(),
      oldWinRel.getInput(),
      oldWinRel.constants,
      oldWinRel.getRowType(),
      builder.build()));
}
 
开发者ID:axbaretto,项目名称:drill,代码行数:45,代码来源:DrillReduceAggregatesRule.java


示例14: visitWindow

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
public T visitWindow(Window window, List<T> inputStreams) throws Exception {
  return defaultValue(window, inputStreams);
}
 
开发者ID:hortonworks,项目名称:streamline,代码行数:4,代码来源:PostOrderRelNodeVisitor.java


示例15: copy

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
@Override
public Window copy(RelTraitSet traitSet, List<RelNode> inputs) {
    assert inputs.size() == 1;
    return new OLAPWindowRel(getCluster(), traitSet, inputs.get(0), constants, rowType, groups);
}
 
开发者ID:apache,项目名称:kylin,代码行数:6,代码来源:OLAPWindowRel.java


示例16: OLAPWindowRule

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


示例17: createEnumerableWindow

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
public static EnumerableWindow createEnumerableWindow(RelOptCluster cluster, RelTraitSet traits, RelNode child,
                                               List<RexLiteral> constants, RelDataType rowType, List<Window.Group> groups) {
    return new EnumerableWindow(cluster, traits, child, constants, rowType, groups);
}
 
开发者ID:apache,项目名称:kylin,代码行数:5,代码来源:EnumerableWindowBridge.java


示例18: collations

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
public ImmutableList<RelCollation> collations(Window rel,
    RelMetadataQuery mq) {
  return ImmutableList.copyOf(window(mq, rel.getInput(), rel.groups));
}
 
开发者ID:apache,项目名称:calcite,代码行数:5,代码来源:RelMdCollation.java


示例19: WindowNode

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
WindowNode(Compiler compiler, Window rel) {
  super(compiler, rel);
}
 
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:WindowNode.java


示例20: visit

import org.apache.calcite.rel.core.Window; //导入依赖的package包/类
public void visit(Window window) {
  node = new WindowNode(this, window);
}
 
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:Nodes.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EnumMessage类代码示例发布时间:2022-05-23
下一篇:
Java ModifyCacheDirectiveRequestProto类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap