Tabnine Logo
Calc.getInput
Code IndexAdd Tabnine to your IDE (free)

How to use
getInput
method
in
org.apache.calcite.rel.core.Calc

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

origin: apache/storm

  @Override
  public RelNode convert(RelNode rel) {
    final Calc calc = (Calc) rel;
    final RelNode input = calc.getInput();

    return new StreamsCalcRel(calc.getCluster(), calc.getTraitSet().replace(StreamsLogicalConvention.INSTANCE),
                 convert(input, input.getTraitSet().replace(StreamsLogicalConvention.INSTANCE)),
                 calc.getProgram());
  }
}
origin: org.apache.calcite/calcite-core

@Override public double estimateRowCount(RelMetadataQuery mq) {
 return RelMdUtil.estimateFilteredRows(getInput(), program, mq);
}
origin: Qihoo360/Quicksql

@Override public double estimateRowCount(RelMetadataQuery mq) {
 return RelMdUtil.estimateFilteredRows(getInput(), program, mq);
}
origin: Qihoo360/Quicksql

public ImmutableList<RelCollation> collations(Calc calc,
  RelMetadataQuery mq) {
 return ImmutableList.copyOf(calc(mq, calc.getInput(), calc.getProgram()));
}
origin: org.apache.calcite/calcite-core

public ImmutableList<RelCollation> collations(Calc calc,
  RelMetadataQuery mq) {
 return ImmutableList.copyOf(calc(mq, calc.getInput(), calc.getProgram()));
}
origin: Qihoo360/Quicksql

public Double getRowCount(Calc rel, RelMetadataQuery mq) {
 return RelMdUtil.estimateFilteredRows(rel.getInput(), rel.getProgram(), mq);
}
origin: org.apache.calcite/calcite-core

public Double getRowCount(Calc rel, RelMetadataQuery mq) {
 return RelMdUtil.estimateFilteredRows(rel.getInput(), rel.getProgram(), mq);
}
origin: org.apache.calcite/calcite-core

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 double dRows = mq.getRowCount(this);
 double dCpu = mq.getRowCount(getInput())
   * program.getExprCount();
 double dIo = 0;
 return planner.getCostFactory().makeCost(dRows, dCpu, dIo);
}
origin: Qihoo360/Quicksql

@Override public RelOptCost computeSelfCost(RelOptPlanner planner,
  RelMetadataQuery mq) {
 double dRows = mq.getRowCount(this);
 double dCpu = mq.getRowCount(getInput())
   * program.getExprCount();
 double dIo = 0;
 return planner.getCostFactory().makeCost(dRows, dCpu, dIo);
}
origin: com.alibaba.blink/flink-table

  public void onMatch(RelOptRuleCall call) {
    final Aggregate aggregate = call.rel(0);
    final Calc calc = call.rel(1);
    final RexProgram program = calc.getProgram();
    final List<RexNode> projects = new ArrayList<>();
    for (RexLocalRef localRef : program.getProjectList()) {
      projects.add(program.expandLocalRef(localRef));
    }
    final Project project = LogicalProject.create(calc.getInput(), projects, calc.getRowType());
    RelNode x = AggregateProjectMergeRule.apply(call, aggregate, project);
    if (x != null) {
      call.transformTo(x);
    }
  }
}
origin: Qihoo360/Quicksql

/**
 * Constructs a CalcRelSplitter.
 *
 * @param calc     Calc to split
 * @param relTypes Array of rel types, e.g. {Java, Fennel}. Must be
 *                 distinct.
 */
CalcRelSplitter(Calc calc, RelBuilder relBuilder, RelType[] relTypes) {
 this.relBuilder = relBuilder;
 for (int i = 0; i < relTypes.length; i++) {
  assert relTypes[i] != null;
  for (int j = 0; j < i; j++) {
   assert relTypes[i] != relTypes[j]
     : "Rel types must be distinct";
  }
 }
 this.program = calc.getProgram();
 this.cluster = calc.getCluster();
 this.traits = calc.getTraitSet();
 this.typeFactory = calc.getCluster().getTypeFactory();
 this.child = calc.getInput();
 this.relTypes = relTypes;
}
origin: org.apache.calcite/calcite-core

/**
 * Constructs a CalcRelSplitter.
 *
 * @param calc     Calc to split
 * @param relTypes Array of rel types, e.g. {Java, Fennel}. Must be
 *                 distinct.
 */
CalcRelSplitter(Calc calc, RelBuilder relBuilder, RelType[] relTypes) {
 this.relBuilder = relBuilder;
 for (int i = 0; i < relTypes.length; i++) {
  assert relTypes[i] != null;
  for (int j = 0; j < i; j++) {
   assert relTypes[i] != relTypes[j]
     : "Rel types must be distinct";
  }
 }
 this.program = calc.getProgram();
 this.cluster = calc.getCluster();
 this.traits = calc.getTraitSet();
 this.typeFactory = calc.getCluster().getTypeFactory();
 this.child = calc.getInput();
 this.relTypes = relTypes;
}
origin: org.apache.calcite/calcite-core

 public RelNode convert(RelNode rel) {
  final Calc calc = (Calc) rel;
  // If there's a multiset, let FarragoMultisetSplitter work on it
  // first.
  if (RexMultisetUtil.containsMultiset(calc.getProgram())) {
   return null;
  }
  return new JdbcCalc(rel.getCluster(), rel.getTraitSet().replace(out),
    convert(calc.getInput(), calc.getTraitSet().replace(out)),
    calc.getProgram());
 }
}
origin: Qihoo360/Quicksql

 public RelNode convert(RelNode rel) {
  final Calc calc = (Calc) rel;
  // If there's a multiset, let FarragoMultisetSplitter work on it
  // first.
  if (RexMultisetUtil.containsMultiset(calc.getProgram())) {
   return null;
  }
  return new JdbcCalc(rel.getCluster(), rel.getTraitSet().replace(out),
    convert(calc.getInput(), calc.getTraitSet().replace(out)),
    calc.getProgram());
 }
}
origin: Qihoo360/Quicksql

 @Override public void onMatch(RelOptRuleCall call) {
  final Calc calc = call.rel(0);
  final Pair<ImmutableList<RexNode>, ImmutableList<RexNode>> projectFilter =
    calc.getProgram().split();
  final RelBuilder relBuilder = call.builder();
  relBuilder.push(calc.getInput());
  relBuilder.filter(projectFilter.right);
  relBuilder.project(projectFilter.left, calc.getRowType().getFieldNames());
  call.transformTo(relBuilder.build());
 }
}
origin: org.apache.calcite/calcite-core

 @Override public void onMatch(RelOptRuleCall call) {
  final Calc calc = call.rel(0);
  final Pair<ImmutableList<RexNode>, ImmutableList<RexNode>> projectFilter =
    calc.getProgram().split();
  final RelBuilder relBuilder = call.builder();
  relBuilder.push(calc.getInput());
  relBuilder.filter(projectFilter.right);
  relBuilder.project(projectFilter.left, calc.getRowType().getFieldNames());
  call.transformTo(relBuilder.build());
 }
}
origin: Qihoo360/Quicksql

public boolean isValid(Litmus litmus, Context context) {
 if (!RelOptUtil.equal(
   "program's input type",
   program.getInputRowType(),
   "child's output type",
   getInput().getRowType(), litmus)) {
  return litmus.fail(null);
 }
 if (!program.isValid(litmus, context)) {
  return litmus.fail(null);
 }
 if (!program.isNormalized(litmus, getCluster().getRexBuilder())) {
  return litmus.fail(null);
 }
 return litmus.succeed();
}
origin: org.apache.calcite/calcite-core

public boolean isValid(Litmus litmus, Context context) {
 if (!RelOptUtil.equal(
   "program's input type",
   program.getInputRowType(),
   "child's output type",
   getInput().getRowType(), litmus)) {
  return litmus.fail(null);
 }
 if (!program.isValid(litmus, context)) {
  return litmus.fail(null);
 }
 if (!program.isNormalized(litmus, getCluster().getRexBuilder())) {
  return litmus.fail(null);
 }
 return litmus.succeed();
}
origin: qubole/quark

public Result visitCalc(Calc e) {
 Result x = visitChild(0, e.getInput());
 final RexProgram program = e.getProgram();
 Builder builder =
   program.getCondition() != null
     ? x.builder(e, Clause.WHERE)
     : x.builder(e);
 if (!isStar(program)) {
  final List<SqlNode> selectList = new ArrayList<>();
  for (RexLocalRef ref : program.getProjectList()) {
   SqlNode sqlExpr = builder.context.toSql(program, ref);
   addSelect(selectList, sqlExpr, e.getRowType());
  }
  builder.setSelect(new SqlNodeList(selectList, POS));
 }
 if (program.getCondition() != null) {
  builder.setWhere(
    builder.context.toSql(program, program.getCondition()));
 }
 return builder.result();
}
origin: Qihoo360/Quicksql

/** @see #dispatch */
public Result visit(Calc e) {
 Result x = visitChild(0, e.getInput());
 parseCorrelTable(e, x);
 final RexProgram program = e.getProgram();
 Builder builder =
   program.getCondition() != null
     ? x.builder(e, Clause.WHERE)
     : x.builder(e);
 if (!isStar(program)) {
  final List<SqlNode> selectList = new ArrayList<>();
  for (RexLocalRef ref : program.getProjectList()) {
   SqlNode sqlExpr = builder.context.toSql(program, ref);
   addSelect(selectList, sqlExpr, e.getRowType());
  }
  builder.setSelect(new SqlNodeList(selectList, POS));
 }
 if (program.getCondition() != null) {
  builder.setWhere(
    builder.context.toSql(program, program.getCondition()));
 }
 return builder.result();
}
org.apache.calcite.rel.coreCalcgetInput

Popular methods of Calc

  • getProgram
  • getCluster
  • getRowType
  • getTraitSet
  • copy
  • getDigest
  • isValid
  • sole

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • startActivity (Activity)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Best IntelliJ 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