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

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

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

origin: Qihoo360/Quicksql

/**
 * Creates a program.
 *
 * <p>The expressions must be valid: they must not contain common expressions,
 * forward references, or non-trivial aggregates.</p>
 *
 * @param inputRowType  Input row type
 * @param exprs         Common expressions
 * @param projects      Projection expressions
 * @param condition     Condition expression. If null, calculator does not
 *                      filter rows
 * @param outputRowType Description of the row produced by the program
 */
public RexProgram(
  RelDataType inputRowType,
  List<? extends RexNode> exprs,
  List<RexLocalRef> projects,
  RexLocalRef condition,
  RelDataType outputRowType) {
 this.inputRowType = inputRowType;
 this.exprs = ImmutableList.copyOf(exprs);
 this.projects = ImmutableList.copyOf(projects);
 this.condition = condition;
 this.outputRowType = outputRowType;
 assert isValid(Litmus.THROW, null);
}
origin: org.apache.calcite/calcite-core

/**
 * Creates a program.
 *
 * <p>The expressions must be valid: they must not contain common expressions,
 * forward references, or non-trivial aggregates.</p>
 *
 * @param inputRowType  Input row type
 * @param exprs         Common expressions
 * @param projects      Projection expressions
 * @param condition     Condition expression. If null, calculator does not
 *                      filter rows
 * @param outputRowType Description of the row produced by the program
 */
public RexProgram(
  RelDataType inputRowType,
  List<? extends RexNode> exprs,
  List<RexLocalRef> projects,
  RexLocalRef condition,
  RelDataType outputRowType) {
 this.inputRowType = inputRowType;
 this.exprs = ImmutableList.copyOf(exprs);
 this.projects = ImmutableList.copyOf(projects);
 this.condition = condition;
 this.outputRowType = outputRowType;
 assert isValid(Litmus.THROW, null);
}
origin: Qihoo360/Quicksql

/**
 * Creates a simplified/normalized copy of this program.
 *
 * @param rexBuilder Rex builder
 * @param simplify Simplifier to simplify (in addition to normalizing),
 *     or null to not simplify
 * @return Normalized program
 */
public RexProgram normalize(RexBuilder rexBuilder, RexSimplify simplify) {
 // Normalize program by creating program builder from the program, then
 // converting to a program. getProgram does not need to normalize
 // because the builder was normalized on creation.
 assert isValid(Litmus.THROW, null);
 final RexProgramBuilder builder =
   RexProgramBuilder.create(rexBuilder, inputRowType, exprs, projects,
     condition, outputRowType, true, simplify);
 return builder.getProgram(false);
}
origin: org.apache.calcite/calcite-core

/**
 * Creates a simplified/normalized copy of this program.
 *
 * @param rexBuilder Rex builder
 * @param simplify Simplifier to simplify (in addition to normalizing),
 *     or null to not simplify
 * @return Normalized program
 */
public RexProgram normalize(RexBuilder rexBuilder, RexSimplify simplify) {
 // Normalize program by creating program builder from the program, then
 // converting to a program. getProgram does not need to normalize
 // because the builder was normalized on creation.
 assert isValid(Litmus.THROW, null);
 final RexProgramBuilder builder =
   RexProgramBuilder.create(rexBuilder, inputRowType, exprs, projects,
     condition, outputRowType, true, simplify);
 return builder.getProgram(false);
}
origin: org.apache.calcite/calcite-core

assert bottomProgram.isValid(Litmus.THROW, null);
assert topProgram.isValid(Litmus.THROW, null);
final RexProgramBuilder progBuilder =
  RexProgramBuilder.forProgram(bottomProgram, rexBuilder, false);
assert mergedProg.isValid(Litmus.THROW, null);
assert mergedProg.getOutputRowType() == topProgram.getOutputRowType();
return mergedProg;
origin: Qihoo360/Quicksql

assert bottomProgram.isValid(Litmus.THROW, null);
assert topProgram.isValid(Litmus.THROW, null);
final RexProgramBuilder progBuilder =
  RexProgramBuilder.forProgram(bottomProgram, rexBuilder, false);
assert mergedProg.isValid(Litmus.THROW, null);
assert mergedProg.getOutputRowType() == topProgram.getOutputRowType();
return mergedProg;
origin: org.apache.calcite/calcite-core

 RexBuilder rexBuilder,
 boolean normalize) {
assert program.isValid(Litmus.THROW, null);
final RelDataType inputRowType = program.getInputRowType();
final List<RexLocalRef> projectRefs = program.getProjectList();
origin: Qihoo360/Quicksql

 RexBuilder rexBuilder,
 boolean normalize) {
assert program.isValid(Litmus.THROW, null);
final RelDataType inputRowType = program.getInputRowType();
final List<RexLocalRef> projectRefs = program.getProjectList();
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: 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

assert program.isValid(Litmus.THROW, null);
final List<RexNode> exprList = program.getExprList();
final RexNode[] exprs = exprList.toArray(new RexNode[0]);
origin: Qihoo360/Quicksql

assert program.isValid(Litmus.THROW, null);
final List<RexNode> exprList = program.getExprList();
final RexNode[] exprs = exprList.toArray(new RexNode[0]);
org.apache.calcite.rexRexProgramisValid

Javadoc

Checks that this program is valid.

If fail is true, executes assert false, so will throw an AssertionError if assertions are enabled. If fail is false, merely returns whether the program is valid.

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
  • create
    Creates a program which calculates projections and filters rows based upon a condition. Does not att
  • 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.
  • getExprCount,
  • getOutputRowType,
  • collectExplainTerms,
  • countTrivial,
  • createIdentity,
  • deduceCollations,
  • explainCalc,
  • getCollations,
  • getPermutation,
  • getSourceField

Popular in Java

  • Making http requests using okhttp
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Menu (java.awt)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • JButton (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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