Tabnine Logo
Window
Code IndexAdd Tabnine to your IDE (free)

How to use
Window
in
org.apache.calcite.rel.core

Best Java code snippets using org.apache.calcite.rel.core.Window (Showing top 20 results out of 315)

origin: apache/kylin

  @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, input.getTraitSet().replace(OLAPRel.CONVENTION)), window.constants, window.getRowType(),
        window.groups);
  }
}
origin: apache/kylin

@Override
public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) {
  return super.computeSelfCost(planner, mq).multiplyBy(.05);
}
origin: dremio/dremio-oss

 @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));
 }
}
origin: Qihoo360/Quicksql

final MutableRel input = toMutable(window.getInput());
return MutableWindow.of(window.getRowType(),
  input, window.groups, window.getConstants());
origin: Qihoo360/Quicksql

 /**
  * Presents a view of the {@link RexWinAggCall} list as a list of
  * {@link AggregateCall}.
  */
 public List<AggregateCall> getAggregateCalls(Window windowRel) {
  final List<String> fieldNames =
    Util.skip(windowRel.getRowType().getFieldNames(),
      windowRel.getInput().getRowType().getFieldCount());
  return new AbstractList<AggregateCall>() {
   public int size() {
    return aggCalls.size();
   }
   public AggregateCall get(int index) {
    final RexWinAggCall aggCall = aggCalls.get(index);
    final SqlAggFunction op = (SqlAggFunction) aggCall.getOperator();
    return AggregateCall.create(op, aggCall.distinct,
      false, getProjectOrdinals(aggCall.getOperands()), -1,
      aggCall.getType(), fieldNames.get(aggCall.ordinal));
   }
  };
 }
}
origin: Qihoo360/Quicksql

public ImmutableList<RelCollation> collations(Window rel,
  RelMetadataQuery mq) {
 return ImmutableList.copyOf(window(mq, rel.getInput(), rel.groups));
}
origin: org.apache.calcite/calcite-core

 public AggregateCall get(int index) {
  final RexWinAggCall aggCall = aggCalls.get(index);
  final SqlAggFunction op = (SqlAggFunction) aggCall.getOperator();
  return AggregateCall.create(op, aggCall.distinct,
    false, getProjectOrdinals(aggCall.getOperands()), -1,
    RelCollations.EMPTY,
    aggCall.getType(), fieldNames.get(aggCall.ordinal));
 }
};
origin: org.apache.drill.exec/drill-java-exec

 @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).simplify();
  final RelNode convertedInput = convert(input, traits);
  call.transformTo(
    new DrillWindowRel(
      window.getCluster(),
      traits,
      convertedInput,
      window.constants,
      window.getRowType(),
      window.groups));
 }
}
origin: org.apache.calcite/calcite-core

final MutableRel input = toMutable(window.getInput());
return MutableWindow.of(window.getRowType(),
  input, window.groups, window.getConstants());
origin: org.apache.calcite/calcite-core

 /**
  * Presents a view of the {@link RexWinAggCall} list as a list of
  * {@link AggregateCall}.
  */
 public List<AggregateCall> getAggregateCalls(Window windowRel) {
  final List<String> fieldNames =
    Util.skip(windowRel.getRowType().getFieldNames(),
      windowRel.getInput().getRowType().getFieldCount());
  return new AbstractList<AggregateCall>() {
   public int size() {
    return aggCalls.size();
   }
   public AggregateCall get(int index) {
    final RexWinAggCall aggCall = aggCalls.get(index);
    final SqlAggFunction op = (SqlAggFunction) aggCall.getOperator();
    return AggregateCall.create(op, aggCall.distinct,
      false, getProjectOrdinals(aggCall.getOperands()), -1,
      RelCollations.EMPTY,
      aggCall.getType(), fieldNames.get(aggCall.ordinal));
   }
  };
 }
}
origin: org.apache.calcite/calcite-core

public ImmutableList<RelCollation> collations(Window rel,
  RelMetadataQuery mq) {
 return ImmutableList.copyOf(window(mq, rel.getInput(), rel.groups));
}
origin: Qihoo360/Quicksql

 public AggregateCall get(int index) {
  final RexWinAggCall aggCall = aggCalls.get(index);
  final SqlAggFunction op = (SqlAggFunction) aggCall.getOperator();
  return AggregateCall.create(op, aggCall.distinct,
    false, getProjectOrdinals(aggCall.getOperands()), -1,
    aggCall.getType(), fieldNames.get(aggCall.ordinal));
 }
};
origin: org.apache.kylin/kylin-query

  @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, input.getTraitSet().replace(OLAPRel.CONVENTION)), window.constants, window.getRowType(),
        window.groups);
  }
}
origin: dremio/dremio-oss

 @Override public RelOptCost computeSelfCost(RelOptPlanner planner,
                       RelMetadataQuery mq) {
  RelOptCost cost = super.computeSelfCost(planner, mq);
  return cost.multiplyBy(WINDOW_COST_FACTOR);
 }
}
origin: org.apache.calcite/calcite-core

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 // Cost is proportional to the number of rows and the number of
 // components (groups and aggregate functions). There is
 // no I/O cost.
 //
 // TODO #1. Add memory cost.
 // TODO #2. MIN and MAX have higher CPU cost than SUM and COUNT.
 final double rowsIn = mq.getRowCount(getInput());
 int count = groups.size();
 for (Group group : groups) {
  count += group.aggCalls.size();
 }
 return planner.getCostFactory().makeCost(rowsIn, rowsIn * count, 0);
}
origin: Qihoo360/Quicksql

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 return super.computeSelfCost(planner, mq)
   .multiplyBy(BindableConvention.COST_MULTIPLIER);
}
origin: Qihoo360/Quicksql

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 // Cost is proportional to the number of rows and the number of
 // components (groups and aggregate functions). There is
 // no I/O cost.
 //
 // TODO #1. Add memory cost.
 // TODO #2. MIN and MAX have higher CPU cost than SUM and COUNT.
 final double rowsIn = mq.getRowCount(getInput());
 int count = groups.size();
 for (Group group : groups) {
  count += group.aggCalls.size();
 }
 return planner.getCostFactory().makeCost(rowsIn, rowsIn * count, 0);
}
origin: org.apache.calcite/calcite-core

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 return super.computeSelfCost(planner, mq)
   .multiplyBy(BindableConvention.COST_MULTIPLIER);
}
origin: org.apache.calcite/calcite-core

final RelDataType childRowType = getInput().getRowType();
origin: Qihoo360/Quicksql

public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) {
 return super.computeSelfCost(planner, mq)
   .multiplyBy(EnumerableConvention.COST_MULTIPLIER);
}
org.apache.calcite.rel.coreWindow

Javadoc

A relational expression representing a set of window aggregates.

A Window can handle several window aggregate functions, over several partitions, with pre- and post-expressions, and an optional post-filter. Each of the partitions is defined by a partition key (zero or more columns) and a range (logical or physical). The partitions expect the data to be sorted correctly on input to the relational expression.

Each Window.Group has a set of org.apache.calcite.rex.RexOver objects.

Created by org.apache.calcite.rel.rules.ProjectToWindowRule.

Most used methods

  • getRowType
  • computeSelfCost
  • getInput
  • getTraitSet
  • getCluster
  • getConstants
    Returns constants that are additional inputs of current relation.
  • getProjectOrdinals
  • explainTerms

Popular in Java

  • Reactive rest calls using spring rest template
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now