Tabnine Logo
RexProgram.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.calcite.rex.RexProgram
constructor

Best Java code snippets using org.apache.calcite.rex.RexProgram.<init> (Showing top 11 results out of 315)

origin: Qihoo360/Quicksql

/**
 * Creates a program that projects its input fields but with possibly
 * different names for the output fields.
 */
public static RexProgram createIdentity(
  RelDataType rowType,
  RelDataType outputRowType) {
 if (rowType != outputRowType
   && !Pair.right(rowType.getFieldList()).equals(
     Pair.right(outputRowType.getFieldList()))) {
  throw new IllegalArgumentException(
    "field type mismatch: " + rowType + " vs. " + outputRowType);
 }
 final List<RelDataTypeField> fields = rowType.getFieldList();
 final List<RexLocalRef> projectRefs = new ArrayList<>();
 final List<RexInputRef> refs = new ArrayList<>();
 for (int i = 0; i < fields.size(); i++) {
  final RexInputRef ref = RexInputRef.of(i, fields);
  refs.add(ref);
  projectRefs.add(new RexLocalRef(i, ref.getType()));
 }
 return new RexProgram(rowType, refs, projectRefs, null, outputRowType);
}
origin: org.apache.calcite/calcite-core

/**
 * Creates a program that projects its input fields but with possibly
 * different names for the output fields.
 */
public static RexProgram createIdentity(
  RelDataType rowType,
  RelDataType outputRowType) {
 if (rowType != outputRowType
   && !Pair.right(rowType.getFieldList()).equals(
     Pair.right(outputRowType.getFieldList()))) {
  throw new IllegalArgumentException(
    "field type mismatch: " + rowType + " vs. " + outputRowType);
 }
 final List<RelDataTypeField> fields = rowType.getFieldList();
 final List<RexLocalRef> projectRefs = new ArrayList<>();
 final List<RexInputRef> refs = new ArrayList<>();
 for (int i = 0; i < fields.size(); i++) {
  final RexInputRef ref = RexInputRef.of(i, fields);
  refs.add(ref);
  projectRefs.add(new RexLocalRef(i, ref.getType()));
 }
 return new RexProgram(rowType, refs, projectRefs, null, outputRowType);
}
origin: Qihoo360/Quicksql

return new RexProgram(
  inputRowType,
  exprList,
origin: org.apache.calcite/calcite-core

return new RexProgram(
  inputRowType,
  exprList,
origin: dremio/dremio-oss

public RexProgram copyOf(RexProgram program) {
 return new RexProgram(
  copyOf(program.getInputRowType()),
  copyRexNodes(program.getExprList()),
  Lists.transform(program.getProjectList(), COPY_REX_LOCAL_REF),
  (RexLocalRef) copyOf(program.getCondition()),
  copyOf(program.getOutputRowType())
 );
}
origin: Qihoo360/Quicksql

new RexProgram(
  inputRowType, exprs, projectRefs, conditionRef, outputRowType);
origin: org.apache.calcite/calcite-core

new RexProgram(
  inputRowType, exprs, projectRefs, conditionRef, outputRowType);
origin: org.apache.calcite/calcite-core

new RexProgram(
  rel.getRowType(),
  exprList,
origin: Qihoo360/Quicksql

new RexProgram(
  rel.getRowType(),
  exprList,
origin: Qihoo360/Quicksql

 public RelNode accept(RexShuttle shuttle) {
  List<RexNode> oldExprs = program.getExprList();
  List<RexNode> exprs = shuttle.apply(oldExprs);
  List<RexLocalRef> oldProjects = program.getProjectList();
  List<RexLocalRef> projects = shuttle.apply(oldProjects);
  RexLocalRef oldCondition = program.getCondition();
  RexNode condition;
  if (oldCondition != null) {
   condition = shuttle.apply(oldCondition);
   assert condition instanceof RexLocalRef
     : "Invalid condition after rewrite. Expected RexLocalRef, got "
     + condition;
  } else {
   condition = null;
  }
  if (exprs == oldExprs
    && projects == oldProjects
    && condition == oldCondition) {
   return this;
  }
  return copy(traitSet, getInput(),
    new RexProgram(program.getInputRowType(),
      exprs,
      projects,
      (RexLocalRef) condition,
      program.getOutputRowType()));
 }
}
origin: org.apache.calcite/calcite-core

 public RelNode accept(RexShuttle shuttle) {
  List<RexNode> oldExprs = program.getExprList();
  List<RexNode> exprs = shuttle.apply(oldExprs);
  List<RexLocalRef> oldProjects = program.getProjectList();
  List<RexLocalRef> projects = shuttle.apply(oldProjects);
  RexLocalRef oldCondition = program.getCondition();
  RexNode condition;
  if (oldCondition != null) {
   condition = shuttle.apply(oldCondition);
   assert condition instanceof RexLocalRef
     : "Invalid condition after rewrite. Expected RexLocalRef, got "
     + condition;
  } else {
   condition = null;
  }
  if (exprs == oldExprs
    && projects == oldProjects
    && condition == oldCondition) {
   return this;
  }
  return copy(traitSet, getInput(),
    new RexProgram(program.getInputRowType(),
      exprs,
      projects,
      (RexLocalRef) condition,
      program.getOutputRowType()));
 }
}
org.apache.calcite.rexRexProgram<init>

Javadoc

Creates a program.

The expressions must be valid: they must not contain common expressions, forward references, or non-trivial aggregates.

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
  • 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

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setContentView (Activity)
  • getSystemService (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Top 12 Jupyter Notebook Extensions
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