• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java AggregateReduceFunctionsRule类的典型用法和代码示例

java 3次浏览

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

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

示例1: testCastInAggregateReduceFunctions

点赞 2

import org.apache.calcite.rel.rules.AggregateReduceFunctionsRule; //导入依赖的package包/类
/** Test case for
 * <a href="https://issues.apache.org/jira/browse/CALCITE-1621">[CALCITE-1621]
 * Adding a cast around the null literal in aggregate rules</a>. */
@Test public void testCastInAggregateReduceFunctions() {
  final HepProgram program =
      HepProgram.builder()
          .addRuleInstance(AggregateReduceFunctionsRule.INSTANCE)
          .build();
  final String sql = "select name, stddev_pop(deptno), avg(deptno),"
      + " stddev_samp(deptno),var_pop(deptno), var_samp(deptno)\n"
      + "from sales.dept group by name";
  sql(sql).with(program).check();
}
 

开发者ID:apache,
项目名称:calcite,
代码行数:14,
代码来源:RelOptRulesTest.java

示例2: testPushAggregateSumThroughJoinAfterAggregateReduce

点赞 2

import org.apache.calcite.rel.rules.AggregateReduceFunctionsRule; //导入依赖的package包/类
/** Test case for
 * <a href="https://issues.apache.org/jira/browse/CALCITE-2108">[CALCITE-2108]
 * AggregateJoinTransposeRule incorrectly splits a SUM0 call when Aggregate
 * has no group keys</a>.
 *
 * <p>Similar to {@link #testPushAggregateSumThroughJoin()},
 * but also uses {@link AggregateReduceFunctionsRule}. */
@Test public void testPushAggregateSumThroughJoinAfterAggregateReduce() {
  final HepProgram preProgram = new HepProgramBuilder()
      .addRuleInstance(AggregateProjectMergeRule.INSTANCE)
      .build();
  final HepProgram program = new HepProgramBuilder()
      .addRuleInstance(AggregateReduceFunctionsRule.INSTANCE)
      .addRuleInstance(AggregateJoinTransposeRule.EXTENDED)
      .build();
  final String sql = "select sum(sal)\n"
      + "from (select * from sales.emp where empno = 10) as e\n"
      + "join sales.dept as d on e.job = d.name";
  checkPlanning(tester, preProgram, new HepPlanner(program), sql);
}
 

开发者ID:apache,
项目名称:calcite,
代码行数:21,
代码来源:RelOptRulesTest.java

示例3: testReduceAverage

点赞 2

import org.apache.calcite.rel.rules.AggregateReduceFunctionsRule; //导入依赖的package包/类
@Test public void testReduceAverage() {
  checkPlanning(AggregateReduceFunctionsRule.INSTANCE,
      "select name, max(name), avg(deptno), min(name)"
          + " from sales.dept group by name");
}
 

开发者ID:apache,
项目名称:calcite,
代码行数:6,
代码来源:RelOptRulesTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)