blob: ab9e33ce29cdf9aebd44709fa8e2d25a00108e5e [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>RexProgram (Apache Calcite API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RexProgram (Apache Calcite API)";
}
}
catch(err) {
}
//-->
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":42,"i31":10,"i32":10,"i33":10,"i34":10,"i35":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 = "../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= 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="class-use/RexProgram.html">Use</a></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>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.rex</a></div>
<h2 title="Class RexProgram" class="title">Class RexProgram</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.calcite.rex.RexProgram</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public class <span class="typeNameLabel">RexProgram</span>
extends java.lang.Object</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 <code>StringBuilder</code>
has to <code>String</code>.
<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>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>(package private) static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="RexProgram.Checker.html" title="class in org.apache.calcite.rex">RexProgram.Checker</a></span></code></th>
<td class="colLast">
<div class="block">Visitor which walks over a program and checks validity.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="RexProgram.ConstantFinder.html" title="class in org.apache.calcite.rex">RexProgram.ConstantFinder</a></span></code></th>
<td class="colLast">
<div class="block">Walks over an expression and determines whether it is constant.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>(package private) static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="RexProgram.ExpansionShuttle.html" title="class in org.apache.calcite.rex">RexProgram.ExpansionShuttle</a></span></code></th>
<td class="colLast">
<div class="block">A RexShuttle used in the implementation of
<a href="#expandLocalRef(org.apache.calcite.rex.RexLocalRef)"><code>expandLocalRef(org.apache.calcite.rex.RexLocalRef)</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="RexProgram.Marshaller.html" title="class in org.apache.calcite.rex">RexProgram.Marshaller</a></span></code></th>
<td class="colLast">
<div class="block">Given an expression in a program, creates a clone of the expression with
sub-expressions (represented by <a href="RexLocalRef.html" title="class in org.apache.calcite.rex"><code>RexLocalRef</code></a>s) fully expanded.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="RexProgram.ReferenceCounter.html" title="class in org.apache.calcite.rex">RexProgram.ReferenceCounter</a></span></code></th>
<td class="colLast">
<div class="block">Visitor which marks which expressions are used.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <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="#condition">condition</a></span></code></th>
<td class="colLast">
<div class="block">The optional condition.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private java.util.List&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="#exprs">exprs</a></span></code></th>
<td class="colLast">
<div class="block">First stage of expression evaluation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <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="#inputRowType">inputRowType</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <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="#outputRowType">outputRowType</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private java.util.List&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="#projects">projects</a></span></code></th>
<td class="colLast">
<div class="block">With <a href="#condition"><code>condition</code></a>, the second stage of expression evaluation.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private int[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#refCounts">refCounts</a></span></code></th>
<td class="colLast">
<div class="block">Reference counts for each expression, computed on demand.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<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,
java.util.List&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprs,
java.util.List&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>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<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>
<tr id="i0" class="altColor">
<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;(java.lang.String&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 id="i1" class="rowColor">
<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;(java.lang.String&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 id="i2" class="altColor">
<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 id="i3" class="rowColor">
<td class="colFirst"><code>private static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#countTrivial(java.util.List)">countTrivial</a></span>&#8203;(java.util.List&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;refs)</code></th>
<td class="colLast">
<div class="block">Returns the number of expressions at the front of an array which are
simply projections of the same field.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<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,
java.util.List&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,
java.util.List&lt;java.lang.String&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 id="i5" class="rowColor">
<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,
java.util.List&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 id="i6" class="altColor">
<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 id="i7" class="rowColor">
<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 id="i8" class="altColor">
<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;(java.util.List&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;outputCollations,
int&nbsp;sourceCount,
java.util.List&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;refs,
java.util.List&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 id="i9" class="rowColor">
<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 id="i10" class="altColor">
<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 id="i11" class="rowColor">
<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 id="i12" class="altColor">
<td class="colFirst"><code>java.util.List&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;(java.util.List&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 id="i13" class="rowColor">
<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 id="i14" class="altColor">
<td class="colFirst"><code>java.util.Set&lt;java.lang.String&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 id="i15" class="rowColor">
<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 id="i16" class="altColor">
<td class="colFirst"><code>java.util.List&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 id="i17" class="rowColor">
<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 id="i18" class="altColor">
<td class="colFirst"><code>java.util.List&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;java.lang.String&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 id="i19" class="rowColor">
<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 id="i20" class="altColor">
<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 id="i21" class="rowColor">
<td class="colFirst"><code>java.util.List&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 id="i22" class="altColor">
<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 id="i23" class="rowColor">
<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 id="i24" class="altColor">
<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 id="i25" class="rowColor">
<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 id="i26" class="altColor">
<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 id="i27" class="rowColor">
<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 id="i28" class="altColor">
<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 id="i29" class="rowColor">
<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 id="i30" class="altColor">
<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 id="i31" class="rowColor">
<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 id="i32" class="altColor">
<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 id="i33" class="rowColor">
<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 id="i34" class="altColor">
<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 id="i35" class="rowColor">
<td class="colFirst"><code>java.lang.String</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>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="exprs">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exprs</h4>
<pre>private final&nbsp;java.util.List&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt; exprs</pre>
<div class="block">First stage of expression evaluation. The expressions in this array can
refer to inputs (using input ordinal #0) or previous expressions in the
array (using input ordinal #1).</div>
</li>
</ul>
<a id="projects">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>projects</h4>
<pre>private final&nbsp;java.util.List&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt; projects</pre>
<div class="block">With <a href="#condition"><code>condition</code></a>, the second stage of expression evaluation.</div>
</li>
</ul>
<a id="condition">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>condition</h4>
<pre>private final&nbsp;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a> condition</pre>
<div class="block">The optional condition. If null, the calculator does not filter rows.</div>
</li>
</ul>
<a id="inputRowType">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>inputRowType</h4>
<pre>private final&nbsp;<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> inputRowType</pre>
</li>
</ul>
<a id="outputRowType">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>outputRowType</h4>
<pre>private final&nbsp;<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a> outputRowType</pre>
</li>
</ul>
<a id="refCounts">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>refCounts</h4>
<pre>private&nbsp;int[] refCounts</pre>
<div class="block">Reference counts for each expression, computed on demand.</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor 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)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RexProgram</h4>
<pre>public&nbsp;RexProgram&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
java.util.List&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprs,
java.util.List&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)</pre>
<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>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getExprList()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExprList</h4>
<pre class="methodSignature">public&nbsp;java.util.List&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;getExprList()</pre>
<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>
</li>
</ul>
<a id="getProjectList()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProjectList</h4>
<pre class="methodSignature">public&nbsp;java.util.List&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;getProjectList()</pre>
<div class="block">Returns an array of references to the expressions which this program is
to project. Never null, may be empty.</div>
</li>
</ul>
<a id="getNamedProjects()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNamedProjects</h4>
<pre class="methodSignature">public&nbsp;java.util.List&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;java.lang.String&gt;&gt;&nbsp;getNamedProjects()</pre>
<div class="block">Returns a list of project expressions and their field names.</div>
</li>
</ul>
<a id="getCondition()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCondition</h4>
<pre class="methodSignature">public&nbsp;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&nbsp;getCondition()</pre>
<div class="block">Returns the field reference of this program's filter condition, or null
if there is no condition.</div>
</li>
</ul>
<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)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre class="methodSignature">public static&nbsp;<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;create&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
java.util.List&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)</pre>
<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>
</li>
</ul>
<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)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre class="methodSignature">public static&nbsp;<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;create&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
java.util.List&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,
java.util.List&lt;java.lang.String&gt;&nbsp;fieldNames,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</pre>
<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>
</li>
</ul>
<a id="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre class="methodSignature">public&nbsp;java.lang.String&nbsp;toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a id="explainCalc(org.apache.calcite.rel.RelWriter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>explainCalc</h4>
<pre class="methodSignature">public&nbsp;<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;explainCalc&#8203;(<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;pw)</pre>
<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>
</li>
</ul>
<a id="collectExplainTerms(java.lang.String,org.apache.calcite.rel.RelWriter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>collectExplainTerms</h4>
<pre class="methodSignature">public&nbsp;<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;collectExplainTerms&#8203;(java.lang.String&nbsp;prefix,
<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;pw)</pre>
</li>
</ul>
<a id="collectExplainTerms(java.lang.String,org.apache.calcite.rel.RelWriter,org.apache.calcite.sql.SqlExplainLevel)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>collectExplainTerms</h4>
<pre class="methodSignature">public&nbsp;<a href="../rel/RelWriter.html" title="interface in org.apache.calcite.rel">RelWriter</a>&nbsp;collectExplainTerms&#8203;(java.lang.String&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)</pre>
<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>
</li>
</ul>
<a id="countTrivial(java.util.List)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>countTrivial</h4>
<pre class="methodSignature">private static&nbsp;int&nbsp;countTrivial&#8203;(java.util.List&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;refs)</pre>
<div class="block">Returns the number of expressions at the front of an array which are
simply projections of the same field.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>refs</code> - References</dd>
</dl>
</li>
</ul>
<a id="getExprCount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExprCount</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getExprCount()</pre>
<div class="block">Returns the number of expressions in this program.</div>
</li>
</ul>
<a id="createIdentity(org.apache.calcite.rel.type.RelDataType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createIdentity</h4>
<pre class="methodSignature">public static&nbsp;<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;createIdentity&#8203;(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;rowType)</pre>
<div class="block">Creates the identity program.</div>
</li>
</ul>
<a id="createIdentity(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rel.type.RelDataType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createIdentity</h4>
<pre class="methodSignature">public static&nbsp;<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;createIdentity&#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)</pre>
<div class="block">Creates a program that projects its input fields but with possibly
different names for the output fields.</div>
</li>
</ul>
<a id="getInputRowType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInputRowType</h4>
<pre class="methodSignature">public&nbsp;<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;getInputRowType()</pre>
<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>
</li>
</ul>
<a id="containsAggs()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>containsAggs</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;containsAggs()</pre>
<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>
</li>
</ul>
<a id="getOutputRowType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOutputRowType</h4>
<pre class="methodSignature">public&nbsp;<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;getOutputRowType()</pre>
<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>
</li>
</ul>
<a id="isValid(org.apache.calcite.util.Litmus,org.apache.calcite.rel.RelNode.Context)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isValid</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isValid&#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)</pre>
<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 <code>AssertionError</code> 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>
</li>
</ul>
<a id="isNull(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isNull</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isNull&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</pre>
<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>
</li>
</ul>
<a id="expandLocalRef(org.apache.calcite.rex.RexLocalRef)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>expandLocalRef</h4>
<pre class="methodSignature">public&nbsp;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expandLocalRef&#8203;(<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&nbsp;ref)</pre>
<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>
</li>
</ul>
<a id="split()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>split</h4>
<pre class="methodSignature">public&nbsp;<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;&nbsp;split()</pre>
<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>
</li>
</ul>
<a id="getCollations(java.util.List)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCollations</h4>
<pre class="methodSignature">public&nbsp;java.util.List&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;getCollations&#8203;(java.util.List&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;inputCollations)</pre>
<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>
</li>
</ul>
<a id="deduceCollations(java.util.List,int,java.util.List,java.util.List)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deduceCollations</h4>
<pre class="methodSignature">public static&nbsp;void&nbsp;deduceCollations&#8203;(java.util.List&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;outputCollations,
int&nbsp;sourceCount,
java.util.List&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;refs,
java.util.List&lt;<a href="../rel/RelCollation.html" title="interface in org.apache.calcite.rel">RelCollation</a>&gt;&nbsp;inputCollations)</pre>
<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>
</li>
</ul>
<a id="projectsIdentity(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>projectsIdentity</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;projectsIdentity&#8203;(boolean&nbsp;fail)</pre>
<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>
</li>
</ul>
<a id="projectsOnlyIdentity()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>projectsOnlyIdentity</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;projectsOnlyIdentity()</pre>
<div class="block">Returns whether this program projects precisely its input fields. It may
or may not apply a condition.</div>
</li>
</ul>
<a id="isTrivial()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isTrivial</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isTrivial()</pre>
<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>
</li>
</ul>
<a id="getReferenceCounts()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getReferenceCounts</h4>
<pre class="methodSignature">public&nbsp;int[]&nbsp;getReferenceCounts()</pre>
<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>
</li>
</ul>
<a id="isConstant(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isConstant</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isConstant&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;ref)</pre>
<div class="block">Returns whether an expression is constant.</div>
</li>
</ul>
<a id="gatherExpr(org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>gatherExpr</h4>
<pre class="methodSignature">public&nbsp;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;gatherExpr&#8203;(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</pre>
</li>
</ul>
<a id="getSourceField(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSourceField</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getSourceField&#8203;(int&nbsp;outputOrdinal)</pre>
<div class="block">Returns the input field that an output field is populated from, or -1 if
it is populated from an expression.</div>
</li>
</ul>
<a id="isPermutation()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isPermutation</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isPermutation()</pre>
<div class="block">Returns whether this program is a permutation of its inputs.</div>
</li>
</ul>
<a id="getPermutation()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPermutation</h4>
<pre class="methodSignature">public&nbsp;<a href="../util/Permutation.html" title="class in org.apache.calcite.util">Permutation</a>&nbsp;getPermutation()</pre>
<div class="block">Returns a permutation, if this program is a permutation, otherwise null.</div>
</li>
</ul>
<a id="getCorrelVariableNames()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCorrelVariableNames</h4>
<pre class="methodSignature">public&nbsp;java.util.Set&lt;java.lang.String&gt;&nbsp;getCorrelVariableNames()</pre>
<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>
</li>
</ul>
<a id="isNormalized(org.apache.calcite.util.Litmus,org.apache.calcite.rex.RexBuilder)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isNormalized</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isNormalized&#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)</pre>
<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>
</li>
</ul>
<a id="normalize(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexSimplify)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normalize</h4>
<pre class="methodSignature">public&nbsp;<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;normalize&#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)</pre>
<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>
</li>
</ul>
<a id="normalize(org.apache.calcite.rex.RexBuilder,boolean)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>normalize</h4>
<pre class="methodSignature">@Deprecated
public&nbsp;<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;normalize&#8203;(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
boolean&nbsp;simplify)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span></div>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<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="class-use/RexProgram.html">Use</a></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>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2012&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>