blob: 76a2ea10f1ebdf47092d5755bbf69207e12f97cf [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>RexProgram (Apache Calcite calcite API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.calcite.rex, class: RexProgram">
<meta name="generator" content="javadoc/ClassWriterImpl">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../script-dir/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.js"></script>
</head>
<body class="class-declaration">
<script type="text/javascript">var data = {"i0":10,"i1":10,"i2":10,"i3":9,"i4":9,"i5":9,"i6":9,"i7":9,"i8":9,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":42,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flexBox">
<header role="banner" class="flexHeader">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><b>Apache Calcite</b></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<div class="navListSearch"><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="skipNav"><a id="skip.navbar.top">
<!-- -->
</a></div>
</nav>
</header>
<div class="flexContent">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.rex</a></div>
<h1 title="Class RexProgram" class="title">Class RexProgram</h1>
</div>
<div class="contentContainer">
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a>
<div class="inheritance">org.apache.calcite.rex.RexProgram</div>
</div>
<section class="description">
<hr>
<pre>public class <span class="typeNameLabel">RexProgram</span>
extends <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></pre>
<div class="block">A collection of expressions which read inputs, compute output expressions,
and optionally use a condition to filter rows.
<p>Programs are immutable. It may help to use a <a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex"><code>RexProgramBuilder</code></a>,
which has the same relationship to <a href="RexProgram.html" title="class in org.apache.calcite.rex"><code>RexProgram</code></a> as <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/StringBuilder.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>StringBuilder</code></a>
has to <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>String</code></a>.
<p>A program can contain aggregate functions. If it does, the arguments to
each aggregate function must be an <a href="RexInputRef.html" title="class in org.apache.calcite.rex"><code>RexInputRef</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex"><code>RexProgramBuilder</code></a></dd>
</dl>
</section>
<section class="summary">
<ul class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li class="blockList">
<section class="constructorSummary"><a id="constructor.summary">
<!-- -->
</a>
<h2>Constructor Summary</h2>
<div class="memberSummary">
<table>
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<thead>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexLocalRef,org.apache.calcite.rel.type.RelDataType)">RexProgram</a></span>&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprs,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;projects,
<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&nbsp;condition,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType)</code></th>
<td class="colLast">
<div class="block">Creates a program.</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li class="blockList">
<section class="methodSummary"><a id="method.summary">
<!-- -->
</a>
<h2>Method Summary</h2>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t1" class="tableTab" onclick="show(1);">Static Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t6" class="tableTab" onclick="show(32);">Deprecated Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<thead>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
</thead>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code><a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#collectExplainTerms(java.lang.String,org.apache.calcite.rel.RelWriter)">collectExplainTerms</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;prefix,
<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;pw)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code><a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#collectExplainTerms(java.lang.String,org.apache.calcite.rel.RelWriter,org.apache.calcite.sql.SqlExplainLevel)">collectExplainTerms</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;prefix,
<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;pw,
<a href="../sql/SqlExplainLevel.html" title="enum in org.apache.calcite.sql">SqlExplainLevel</a>&nbsp;level)</code></th>
<td class="colLast">
<div class="block">Collects the expressions in this program into a list of terms and values.</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#containsAggs()">containsAggs</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether this program contains windowed aggregate functions.</div>
</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>static <a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#create(org.apache.calcite.rel.RelInput)">create</a></span>&#8203;(<a href="../rel/RelInput.html" title="interface in org.apache.calcite.rel">RelInput</a>&nbsp;input)</code></th>
<td class="colLast">
<div class="block">Create a program from serialized output.</div>
</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code>static <a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#create(org.apache.calcite.rel.type.RelDataType,java.util.List,org.apache.calcite.rex.RexNode,java.util.List,org.apache.calcite.rex.RexBuilder)">create</a></span>&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectExprs,
<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;conditionExpr,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&nbsp;fieldNames,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</code></th>
<td class="colLast">
<div class="block">Creates a program which calculates projections and filters rows based
upon a condition.</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code>static <a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#create(org.apache.calcite.rel.type.RelDataType,java.util.List,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexBuilder)">create</a></span>&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectExprs,
<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;conditionExpr,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</code></th>
<td class="colLast">
<div class="block">Creates a program which calculates projections and filters rows based
upon a condition.</div>
</td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code>static <a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createIdentity(org.apache.calcite.rel.type.RelDataType)">createIdentity</a></span>&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;rowType)</code></th>
<td class="colLast">
<div class="block">Creates the identity program.</div>
</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code>static <a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#createIdentity(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">createIdentity</a></span>&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;rowType,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType)</code></th>
<td class="colLast">
<div class="block">Creates a program that projects its input fields but with possibly
different names for the output fields.</div>
</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code>static void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#deduceCollations(java.util.List,int,java.util.List,java.util.List)">deduceCollations</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;outputCollations,
int&nbsp;sourceCount,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;refs,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;inputCollations)</code></th>
<td class="colLast">
<div class="block">Given a list of expressions and a description of which are ordered,
populates a list of collations, sorted in natural order.</div>
</td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#expandLocalRef(org.apache.calcite.rex.RexLocalRef)">expandLocalRef</a></span>&#8203;(<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&nbsp;ref)</code></th>
<td class="colLast">
<div class="block">Fully expands a RexLocalRef back into a pure RexNode tree containing no
RexLocalRefs (reversing the effect of common subexpression elimination).</div>
</td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code><a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#explainCalc(org.apache.calcite.rel.RelWriter)">explainCalc</a></span>&#8203;(<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;pw)</code></th>
<td class="colLast">
<div class="block">Writes an explanation of the expressions in this program to a plan
writer.</div>
</td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#gatherExpr(org.apache.calcite.rex.RexNode)">gatherExpr</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCollations(java.util.List)">getCollations</a></span>&#8203;(<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;inputCollations)</code></th>
<td class="colLast">
<div class="block">Given a list of collations which hold for the input to this program,
returns a list of collations which hold for its output.</div>
</td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCondition()">getCondition</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the field reference of this program's filter condition, or null
if there is no condition.</div>
</td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a>&lt;<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCorrelVariableNames()">getCorrelVariableNames</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the set of correlation variables used (read) by this program.</div>
</td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getExprCount()">getExprCount</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the number of expressions in this program.</div>
</td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getExprList()">getExprList</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the common sub-expressions of this program.</div>
</td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getInputRowType()">getInputRowType</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the type of the input row to the program.</div>
</td>
</tr>
<tr class="altColor" id="i18">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../util/Pair.html" title="class in org.apache.calcite.util">Pair</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>,&#8203;<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNamedProjects()">getNamedProjects</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a list of project expressions and their field names.</div>
</td>
</tr>
<tr class="rowColor" id="i19">
<td class="colFirst"><code><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getOutputRowType()">getOutputRowType</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the type of the output row from this program.</div>
</td>
</tr>
<tr class="altColor" id="i20">
<td class="colFirst"><code><a href="../util/mapping/Mappings.TargetMapping.html" title="interface in org.apache.calcite.util.mapping">Mappings.TargetMapping</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPartialMapping(int)">getPartialMapping</a></span>&#8203;(int&nbsp;inputFieldCount)</code></th>
<td class="colLast">
<div class="block">Returns a partial mapping of a set of project expressions.</div>
</td>
</tr>
<tr class="rowColor" id="i21">
<td class="colFirst"><code><a href="../util/Permutation.html" title="class in org.apache.calcite.util">Permutation</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPermutation()">getPermutation</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a permutation, if this program is a permutation, otherwise null.</div>
</td>
</tr>
<tr class="altColor" id="i22">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getProjectList()">getProjectList</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns an array of references to the expressions which this program is
to project.</div>
</td>
</tr>
<tr class="rowColor" id="i23">
<td class="colFirst"><code>int[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getReferenceCounts()">getReferenceCounts</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets reference counts for each expression in the program, where the
references are detected from later expressions in the same program, as
well as the project list and condition.</div>
</td>
</tr>
<tr class="altColor" id="i24">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSourceField(int)">getSourceField</a></span>&#8203;(int&nbsp;outputOrdinal)</code></th>
<td class="colLast">
<div class="block">Returns the input field that an output field is populated from, or -1 if
it is populated from an expression.</div>
</td>
</tr>
<tr class="rowColor" id="i25">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isConstant(org.apache.calcite.rex.RexNode)">isConstant</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;ref)</code></th>
<td class="colLast">
<div class="block">Returns whether an expression is constant.</div>
</td>
</tr>
<tr class="altColor" id="i26">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isNormalized(org.apache.calcite.util.Litmus,org.apache.calcite.rex.RexBuilder)">isNormalized</a></span>&#8203;(<a href="../util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a>&nbsp;litmus,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</code></th>
<td class="colLast">
<div class="block">Returns whether this program is in canonical form.</div>
</td>
</tr>
<tr class="rowColor" id="i27">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isNull(org.apache.calcite.rex.RexNode)">isNull</a></span>&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</code></th>
<td class="colLast">
<div class="block">Returns whether an expression always evaluates to null.</div>
</td>
</tr>
<tr class="altColor" id="i28">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isPermutation()">isPermutation</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether this program is a permutation of its inputs.</div>
</td>
</tr>
<tr class="rowColor" id="i29">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isTrivial()">isTrivial</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether this program returns its input exactly.</div>
</td>
</tr>
<tr class="altColor" id="i30">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isValid(org.apache.calcite.util.Litmus,org.apache.calcite.rel.RelNode.Context)">isValid</a></span>&#8203;(<a href="../util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a>&nbsp;litmus,
<a href="../rel/RelNode.Context.html" title="interface in org.apache.calcite.rel">RelNode.Context</a>&nbsp;context)</code></th>
<td class="colLast">
<div class="block">Checks that this program is valid.</div>
</td>
</tr>
<tr class="rowColor" id="i31">
<td class="colFirst"><code><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#normalize(org.apache.calcite.rex.RexBuilder,boolean)">normalize</a></span>&#8203;(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
boolean&nbsp;simplify)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span></div>
</td>
</tr>
<tr class="altColor" id="i32">
<td class="colFirst"><code><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#normalize(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexSimplify)">normalize</a></span>&#8203;(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="RexSimplify.html" title="class in org.apache.calcite.rex">RexSimplify</a>&nbsp;simplify)</code></th>
<td class="colLast">
<div class="block">Creates a simplified/normalized copy of this program.</div>
</td>
</tr>
<tr class="rowColor" id="i33">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#projectsIdentity(boolean)">projectsIdentity</a></span>&#8203;(boolean&nbsp;fail)</code></th>
<td class="colLast">
<div class="block">Returns whether the fields on the leading edge of the project list are
the input fields.</div>
</td>
</tr>
<tr class="altColor" id="i34">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#projectsOnlyIdentity()">projectsOnlyIdentity</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether this program projects precisely its input fields.</div>
</td>
</tr>
<tr class="rowColor" id="i35">
<td class="colFirst"><code><a href="../util/Pair.html" title="class in org.apache.calcite.util">Pair</a>&lt;com.google.common.collect.ImmutableList&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;,&#8203;com.google.common.collect.ImmutableList&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#split()">split</a></span>()</code></th>
<td class="colLast">
<div class="block">Splits this program into a list of project expressions and a list of
filter expressions.</div>
</td>
</tr>
<tr class="altColor" id="i36">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="inheritedList">
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li class="blockList">
<section class="constructorDetails"><a id="constructor.detail">
<!-- -->
</a>
<h2>Constructor Details</h2>
<ul class="blockList">
<li class="blockList">
<section class="detail">
<h3><a id="&lt;init&gt;(org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexLocalRef,org.apache.calcite.rel.type.RelDataType)">RexProgram</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="memberName">RexProgram</span>&#8203;(<span class="arguments"><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprs,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;projects,
<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&nbsp;condition,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType)</span></div>
<div class="block">Creates a program.
<p>The expressions must be valid: they must not contain common expressions,
forward references, or non-trivial aggregates.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputRowType</code> - Input row type</dd>
<dd><code>exprs</code> - Common expressions</dd>
<dd><code>projects</code> - Projection expressions</dd>
<dd><code>condition</code> - Condition expression. If null, calculator does not
filter rows</dd>
<dd><code>outputRowType</code> - Description of the row produced by the program</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li class="blockList">
<section class="methodDetails"><a id="method.detail">
<!-- -->
</a>
<h2>Method Details</h2>
<ul class="blockList">
<li class="blockList">
<section class="detail">
<h3><a id="getExprList()">getExprList</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;</span>&nbsp;<span class="memberName">getExprList</span>()</div>
<div class="block">Returns the common sub-expressions of this program.
<p>The list is never null but may be empty; each the expression in the
list is not null; and no further reduction into smaller common
sub-expressions is possible.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getProjectList()">getProjectList</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;</span>&nbsp;<span class="memberName">getProjectList</span>()</div>
<div class="block">Returns an array of references to the expressions which this program is
to project. Never null, may be empty.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getNamedProjects()">getNamedProjects</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../util/Pair.html" title="class in org.apache.calcite.util">Pair</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>,&#8203;<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&gt;</span>&nbsp;<span class="memberName">getNamedProjects</span>()</div>
<div class="block">Returns a list of project expressions and their field names.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getCondition()">getCondition</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="memberName">getCondition</span>()</div>
<div class="block">Returns the field reference of this program's filter condition, or null
if there is no condition.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="create(org.apache.calcite.rel.type.RelDataType,java.util.List,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexBuilder)">create</a></h3>
<div class="memberSignature"><span class="modifiers">public static</span>&nbsp;<span class="returnType"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="memberName">create</span>&#8203;(<span class="arguments"><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectExprs,
<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;conditionExpr,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</span></div>
<div class="block">Creates a program which calculates projections and filters rows based
upon a condition. Does not attempt to eliminate common sub-expressions.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>projectExprs</code> - Project expressions</dd>
<dd><code>conditionExpr</code> - Condition on which to filter rows, or null if rows
are not to be filtered</dd>
<dd><code>outputRowType</code> - Output row type</dd>
<dd><code>rexBuilder</code> - Builder of rex expressions</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A program</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="create(org.apache.calcite.rel.type.RelDataType,java.util.List,org.apache.calcite.rex.RexNode,java.util.List,org.apache.calcite.rex.RexBuilder)">create</a></h3>
<div class="memberSignature"><span class="modifiers">public static</span>&nbsp;<span class="returnType"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="memberName">create</span>&#8203;(<span class="arguments"><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectExprs,
<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;conditionExpr,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;&nbsp;fieldNames,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</span></div>
<div class="block">Creates a program which calculates projections and filters rows based
upon a condition. Does not attempt to eliminate common sub-expressions.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>projectExprs</code> - Project expressions</dd>
<dd><code>conditionExpr</code> - Condition on which to filter rows, or null if rows
are not to be filtered</dd>
<dd><code>fieldNames</code> - Names of projected fields</dd>
<dd><code>rexBuilder</code> - Builder of rex expressions</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A program</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="create(org.apache.calcite.rel.RelInput)">create</a></h3>
<div class="memberSignature"><span class="modifiers">public static</span>&nbsp;<span class="returnType"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="memberName">create</span>&#8203;(<span class="arguments"><a href="../rel/RelInput.html" title="interface in org.apache.calcite.rel">RelInput</a>&nbsp;input)</span></div>
<div class="block">Create a program from serialized output.
In this case, the input is mainly from the output json string of <a href="../rel/externalize/RelJsonWriter.html" title="class in org.apache.calcite.rel.externalize"><code>RelJsonWriter</code></a></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="toString()">toString</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></span>&nbsp;<span class="memberName">toString</span>()</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="explainCalc(org.apache.calcite.rel.RelWriter)">explainCalc</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a></span>&nbsp;<span class="memberName">explainCalc</span>&#8203;(<span class="arguments"><a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;pw)</span></div>
<div class="block">Writes an explanation of the expressions in this program to a plan
writer.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pw</code> - Plan writer</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="collectExplainTerms(java.lang.String,org.apache.calcite.rel.RelWriter)">collectExplainTerms</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a></span>&nbsp;<span class="memberName">collectExplainTerms</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;prefix,
<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;pw)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="collectExplainTerms(java.lang.String,org.apache.calcite.rel.RelWriter,org.apache.calcite.sql.SqlExplainLevel)">collectExplainTerms</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a></span>&nbsp;<span class="memberName">collectExplainTerms</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;prefix,
<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;pw,
<a href="../sql/SqlExplainLevel.html" title="enum in org.apache.calcite.sql">SqlExplainLevel</a>&nbsp;level)</span></div>
<div class="block">Collects the expressions in this program into a list of terms and values.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>prefix</code> - Prefix for term names, usually the empty string, but useful
if a relational expression contains more than one program</dd>
<dd><code>pw</code> - Plan writer</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getExprCount()">getExprCount</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">int</span>&nbsp;<span class="memberName">getExprCount</span>()</div>
<div class="block">Returns the number of expressions in this program.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="createIdentity(org.apache.calcite.rel.type.RelDataType)">createIdentity</a></h3>
<div class="memberSignature"><span class="modifiers">public static</span>&nbsp;<span class="returnType"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="memberName">createIdentity</span>&#8203;(<span class="arguments"><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;rowType)</span></div>
<div class="block">Creates the identity program.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="createIdentity(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">createIdentity</a></h3>
<div class="memberSignature"><span class="modifiers">public static</span>&nbsp;<span class="returnType"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="memberName">createIdentity</span>&#8203;(<span class="arguments"><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;rowType,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType)</span></div>
<div class="block">Creates a program that projects its input fields but with possibly
different names for the output fields.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getInputRowType()">getInputRowType</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></span>&nbsp;<span class="memberName">getInputRowType</span>()</div>
<div class="block">Returns the type of the input row to the program.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>input row type</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="containsAggs()">containsAggs</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">containsAggs</span>()</div>
<div class="block">Returns whether this program contains windowed aggregate functions.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether this program contains windowed aggregate functions</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getOutputRowType()">getOutputRowType</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></span>&nbsp;<span class="memberName">getOutputRowType</span>()</div>
<div class="block">Returns the type of the output row from this program.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>output row type</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="isValid(org.apache.calcite.util.Litmus,org.apache.calcite.rel.RelNode.Context)">isValid</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">isValid</span>&#8203;(<span class="arguments"><a href="../util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a>&nbsp;litmus,
<a href="../rel/RelNode.Context.html" title="interface in org.apache.calcite.rel">RelNode.Context</a>&nbsp;context)</span></div>
<div class="block">Checks that this program is valid.
<p>If <code>fail</code> is true, executes <code>assert false</code>, so
will throw an <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/AssertionError.html?is-external=true" title="class or interface in java.lang" class="externalLink"><code>AssertionError</code></a> if assertions are enabled. If <code>
fail</code> is false, merely returns whether the program is valid.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>litmus</code> - What to do if an error is detected</dd>
<dd><code>context</code> - Context of enclosing <a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel"><code>RelNode</code></a>, for validity checking,
or null if not known</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether the program is valid</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="isNull(org.apache.calcite.rex.RexNode)">isNull</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">isNull</span>&#8203;(<span class="arguments"><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</span></div>
<div class="block">Returns whether an expression always evaluates to null.
<p>Like <a href="RexUtil.html#isNull(org.apache.calcite.rex.RexNode)"><code>RexUtil.isNull(RexNode)</code></a>, null literals are null, and
casts of null literals are null. But this method also regards references
to null expressions as null.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>expr</code> - Expression</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether expression always evaluates to null</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="expandLocalRef(org.apache.calcite.rex.RexLocalRef)">expandLocalRef</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></span>&nbsp;<span class="memberName">expandLocalRef</span>&#8203;(<span class="arguments"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&nbsp;ref)</span></div>
<div class="block">Fully expands a RexLocalRef back into a pure RexNode tree containing no
RexLocalRefs (reversing the effect of common subexpression elimination).
For example, <code>program.expandLocalRef(program.getCondition())</code>
will return the expansion of a program's condition.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>ref</code> - a RexLocalRef from this program</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>expanded form</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="split()">split</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="../util/Pair.html" title="class in org.apache.calcite.util">Pair</a>&lt;com.google.common.collect.ImmutableList&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;,&#8203;com.google.common.collect.ImmutableList&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&gt;</span>&nbsp;<span class="memberName">split</span>()</div>
<div class="block">Splits this program into a list of project expressions and a list of
filter expressions.
<p>Neither list is null.
The filters are evaluated first.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getCollations(java.util.List)">getCollations</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;</span>&nbsp;<span class="memberName">getCollations</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;inputCollations)</span></div>
<div class="block">Given a list of collations which hold for the input to this program,
returns a list of collations which hold for its output. The result is
mutable and sorted.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="deduceCollations(java.util.List,int,java.util.List,java.util.List)">deduceCollations</a></h3>
<div class="memberSignature"><span class="modifiers">public static</span>&nbsp;<span class="returnType">void</span>&nbsp;<span class="memberName">deduceCollations</span>&#8203;(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;outputCollations,
int&nbsp;sourceCount,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;refs,
<a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a>&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;inputCollations)</span></div>
<div class="block">Given a list of expressions and a description of which are ordered,
populates a list of collations, sorted in natural order.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="projectsIdentity(boolean)">projectsIdentity</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">projectsIdentity</span>&#8203;(<span class="arguments">boolean&nbsp;fail)</span></div>
<div class="block">Returns whether the fields on the leading edge of the project list are
the input fields.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fail</code> - Whether to throw an assert failure if does not project
identity</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="projectsOnlyIdentity()">projectsOnlyIdentity</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">projectsOnlyIdentity</span>()</div>
<div class="block">Returns whether this program projects precisely its input fields. It may
or may not apply a condition.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="isTrivial()">isTrivial</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">isTrivial</span>()</div>
<div class="block">Returns whether this program returns its input exactly.
<p>This is a stronger condition than <a href="#projectsIdentity(boolean)"><code>projectsIdentity(boolean)</code></a>.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getReferenceCounts()">getReferenceCounts</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">int[]</span>&nbsp;<span class="memberName">getReferenceCounts</span>()</div>
<div class="block">Gets reference counts for each expression in the program, where the
references are detected from later expressions in the same program, as
well as the project list and condition. Expressions with references
counts greater than 1 are true common sub-expressions.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>array of reference counts; the ith element in the returned array
is the number of references to getExprList()[i]</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="isConstant(org.apache.calcite.rex.RexNode)">isConstant</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">isConstant</span>&#8203;(<span class="arguments"><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;ref)</span></div>
<div class="block">Returns whether an expression is constant.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="gatherExpr(org.apache.calcite.rex.RexNode)">gatherExpr</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></span>&nbsp;<span class="memberName">gatherExpr</span>&#8203;(<span class="arguments"><a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getSourceField(int)">getSourceField</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">int</span>&nbsp;<span class="memberName">getSourceField</span>&#8203;(<span class="arguments">int&nbsp;outputOrdinal)</span></div>
<div class="block">Returns the input field that an output field is populated from, or -1 if
it is populated from an expression.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="isPermutation()">isPermutation</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">isPermutation</span>()</div>
<div class="block">Returns whether this program is a permutation of its inputs.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getPermutation()">getPermutation</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="../util/Permutation.html" title="class in org.apache.calcite.util">Permutation</a></span>&nbsp;<span class="memberName">getPermutation</span>()</div>
<div class="block">Returns a permutation, if this program is a permutation, otherwise null.</div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getCorrelVariableNames()">getCorrelVariableNames</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util" class="externalLink">Set</a>&lt;<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&gt;</span>&nbsp;<span class="memberName">getCorrelVariableNames</span>()</div>
<div class="block">Returns the set of correlation variables used (read) by this program.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>set of correlation variable names</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="isNormalized(org.apache.calcite.util.Litmus,org.apache.calcite.rex.RexBuilder)">isNormalized</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType">boolean</span>&nbsp;<span class="memberName">isNormalized</span>&#8203;(<span class="arguments"><a href="../util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a>&nbsp;litmus,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</span></div>
<div class="block">Returns whether this program is in canonical form.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>litmus</code> - What to do if an error is detected (program is not in
canonical form)</dd>
<dd><code>rexBuilder</code> - Rex builder</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>whether in canonical form</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="normalize(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexSimplify)">normalize</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="memberName">normalize</span>&#8203;(<span class="arguments"><a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="RexSimplify.html" title="class in org.apache.calcite.rex">RexSimplify</a>&nbsp;simplify)</span></div>
<div class="block">Creates a simplified/normalized copy of this program.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>rexBuilder</code> - Rex builder</dd>
<dd><code>simplify</code> - Simplifier to simplify (in addition to normalizing),
or null to not simplify</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Normalized program</dd>
</dl>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="normalize(org.apache.calcite.rex.RexBuilder,boolean)">normalize</a></h3>
<div class="memberSignature"><span class="annotations"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink">@Deprecated</a>
</span><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="memberName">normalize</span>&#8203;(<span class="arguments"><a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
boolean&nbsp;simplify)</span></div>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div>
</section>
</li>
<li class="blockList">
<section class="detail">
<h3><a id="getPartialMapping(int)">getPartialMapping</a></h3>
<div class="memberSignature"><span class="modifiers">public</span>&nbsp;<span class="returnType"><a href="../util/mapping/Mappings.TargetMapping.html" title="interface in org.apache.calcite.util.mapping">Mappings.TargetMapping</a></span>&nbsp;<span class="memberName">getPartialMapping</span>&#8203;(<span class="arguments">int&nbsp;inputFieldCount)</span></div>
<div class="block">Returns a partial mapping of a set of project expressions.
<p>The mapping is an inverse function.
Every target has a source field, but
a source might have 0, 1 or more targets.
Project expressions that do not consist of
a mapping are ignored.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputFieldCount</code> - Number of input fields</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Mapping of a set of project expressions, never null</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
</div>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><b>Apache Calcite</b></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &copy; 2012-2020 Apache Software Foundation. All Rights Reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>