Tabnine Logo
RexProgram.create
Code IndexAdd Tabnine to your IDE (free)

How to use
create
method
in
org.apache.calcite.rex.RexProgram

Best Java code snippets using org.apache.calcite.rex.RexProgram.create (Showing top 17 results out of 315)

origin: apache/kylin

@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
  if (getInput() instanceof OLAPFilterRel) {
    // merge project & filter
    OLAPFilterRel filter = (OLAPFilterRel) getInput();
    RelNode inputOfFilter = inputs.get(0).getInput(0);
    RexProgram program = RexProgram.create(inputOfFilter.getRowType(), this.rewriteProjects,
        filter.getCondition(), this.rowType, getCluster().getRexBuilder());
    return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), //
        inputOfFilter, program);
  } else {
    // keep project for table scan
    EnumerableRel input = sole(inputs);
    RexProgram program = RexProgram.create(input.getRowType(), this.rewriteProjects, null, this.rowType,
        getCluster().getRexBuilder());
    return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), //
        input, program);
  }
}
origin: org.apache.calcite/calcite-core

/**
 * Creates a program which calculates projections and filters rows based
 * upon a condition. Does not attempt to eliminate common sub-expressions.
 *
 * @param projectExprs  Project expressions
 * @param conditionExpr Condition on which to filter rows, or null if rows
 *                      are not to be filtered
 * @param outputRowType Output row type
 * @param rexBuilder    Builder of rex expressions
 * @return A program
 */
public static RexProgram create(
  RelDataType inputRowType,
  List<? extends RexNode> projectExprs,
  RexNode conditionExpr,
  RelDataType outputRowType,
  RexBuilder rexBuilder) {
 return create(inputRowType, projectExprs, conditionExpr,
   outputRowType.getFieldNames(), rexBuilder);
}
origin: Qihoo360/Quicksql

/**
 * Creates a program which calculates projections and filters rows based
 * upon a condition. Does not attempt to eliminate common sub-expressions.
 *
 * @param projectExprs  Project expressions
 * @param conditionExpr Condition on which to filter rows, or null if rows
 *                      are not to be filtered
 * @param outputRowType Output row type
 * @param rexBuilder    Builder of rex expressions
 * @return A program
 */
public static RexProgram create(
  RelDataType inputRowType,
  List<? extends RexNode> projectExprs,
  RexNode conditionExpr,
  RelDataType outputRowType,
  RexBuilder rexBuilder) {
 return create(inputRowType, projectExprs, conditionExpr,
   outputRowType.getFieldNames(), rexBuilder);
}
origin: org.apache.kylin/atopcalcite

 projects.add(rexBuilder.makeInputRef(enumerable, field));
RexProgram program = RexProgram.create(enumerable.getRowType(),
  projects, null, root.validatedRowType, rexBuilder);
enumerable = EnumerableCalc.create(enumerable, program);
origin: Qihoo360/Quicksql

 projects.add(rexBuilder.makeInputRef(enumerable, field));
RexProgram program = RexProgram.create(enumerable.getRowType(),
  projects, null, root.validatedRowType, rexBuilder);
enumerable = EnumerableCalc.create(enumerable, program);
origin: org.apache.calcite/calcite-core

 projects.add(rexBuilder.makeInputRef(enumerable, field));
RexProgram program = RexProgram.create(enumerable.getRowType(),
  projects, null, root.validatedRowType, rexBuilder);
enumerable = EnumerableCalc.create(enumerable, program);
origin: Qihoo360/Quicksql

 public void onMatch(RelOptRuleCall call) {
  final EnumerableProject project = call.rel(0);
  final RelNode input = project.getInput();
  final RexProgram program =
    RexProgram.create(input.getRowType(),
      project.getProjects(),
      null,
      project.getRowType(),
      project.getCluster().getRexBuilder());
  final EnumerableCalc calc = EnumerableCalc.create(input, program);
  call.transformTo(calc);
 }
}
origin: org.apache.calcite/calcite-core

 public void onMatch(RelOptRuleCall call) {
  final EnumerableProject project = call.rel(0);
  final RelNode input = project.getInput();
  final RexProgram program =
    RexProgram.create(input.getRowType(),
      project.getProjects(),
      null,
      project.getRowType(),
      project.getCluster().getRexBuilder());
  final EnumerableCalc calc = EnumerableCalc.create(input, program);
  call.transformTo(calc);
 }
}
origin: org.apache.calcite/calcite-core

 public void onMatch(RelOptRuleCall call) {
  final LogicalProject project = call.rel(0);
  final RelNode input = project.getInput();
  final RexProgram program =
    RexProgram.create(
      input.getRowType(),
      project.getProjects(),
      null,
      project.getRowType(),
      project.getCluster().getRexBuilder());
  final LogicalCalc calc = LogicalCalc.create(input, program);
  call.transformTo(calc);
 }
}
origin: Qihoo360/Quicksql

 public void onMatch(RelOptRuleCall call) {
  final LogicalProject project = call.rel(0);
  final RelNode input = project.getInput();
  final RexProgram program =
    RexProgram.create(
      input.getRowType(),
      project.getProjects(),
      null,
      project.getRowType(),
      project.getCluster().getRexBuilder());
  final LogicalCalc calc = LogicalCalc.create(input, program);
  call.transformTo(calc);
 }
}
origin: org.apache.kylin/kylin-query

@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
  if (getInput() instanceof OLAPFilterRel) {
    // merge project & filter
    OLAPFilterRel filter = (OLAPFilterRel) getInput();
    RelNode inputOfFilter = inputs.get(0).getInput(0);
    RexProgram program = RexProgram.create(inputOfFilter.getRowType(), this.rewriteProjects,
        filter.getCondition(), this.rowType, getCluster().getRexBuilder());
    return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), //
        inputOfFilter, program);
  } else {
    // keep project for table scan
    EnumerableRel input = sole(inputs);
    RexProgram program = RexProgram.create(input.getRowType(), this.rewriteProjects, null, this.rowType,
        getCluster().getRexBuilder());
    return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), //
        input, program);
  }
}
origin: Qihoo360/Quicksql

final RelNode input = project.getInput();
final RexProgram program =
  RexProgram.create(
    input.getRowType(),
    project.getProjects(),
origin: org.apache.calcite/calcite-core

final RelNode input = project.getInput();
final RexProgram program =
  RexProgram.create(
    input.getRowType(),
    project.getProjects(),
origin: org.apache.calcite/calcite-core

RexProgram.create(
  joinChildrenRowType,
  Pair.left(projects),
origin: Qihoo360/Quicksql

RexProgram.create(
  joinChildrenRowType,
  Pair.left(projects),
origin: org.apache.calcite/calcite-core

RexProgram.create(
  calc.getRowType(),
  project.getProjects(),
origin: Qihoo360/Quicksql

RexProgram.create(
  calc.getRowType(),
  project.getProjects(),
org.apache.calcite.rexRexProgramcreate

Javadoc

Creates a program which calculates projections and filters rows based upon a condition. Does not attempt to eliminate common sub-expressions.

Popular methods of RexProgram

  • expandLocalRef
    Fully expands a RexLocalRef back into a pure RexNode tree containing no RexLocalRefs (reversing the
  • getCondition
    Returns the field reference of this program's filter condition, or null if there is no condition.
  • getInputRowType
    Returns the type of the input row to the program.
  • getProjectList
    Returns an array of references to the expressions which this program is to project. Never null, may
  • getExprList
    Returns the common sub-expressions of this program.The list is never null but may be empty; each the
  • normalize
  • toString
  • <init>
    Creates a program.The expressions must be valid: they must not contain common expressions, forward r
  • containsAggs
    Returns whether this program contains windowed aggregate functions
  • getExprCount
    Returns the number of expressions in this program.
  • getOutputRowType
    Returns the type of the output row from this program.
  • collectExplainTerms
    Collects the expressions in this program into a list of terms and values.
  • getOutputRowType,
  • collectExplainTerms,
  • countTrivial,
  • createIdentity,
  • deduceCollations,
  • explainCalc,
  • getCollations,
  • getPermutation,
  • getSourceField

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • getApplicationContext (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Path (java.nio.file)
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • JButton (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • 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