blob: 7a5734464821444a7fcf38991d0cafaed7278a68 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>RexProgramBuilder (Apache Calcite API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.calcite.rex, class: RexProgramBuilder">
<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.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var evenRowColor = "even-row-color";
var oddRowColor = "odd-row-color";
var tableTab = "table-tab";
var activeTableTab = "active-table-tab";
var pathtoroot = "../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top">
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<div class="about-language"><b>Apache Calcite</b></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">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#class">Help</a></li>
</ul>
</div>
<div class="sub-nav">
<div>
<ul class="sub-nav-list">
<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="sub-nav-list">
<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="nav-list-search"><label for="search-input">SEARCH:</label>
<input type="text" id="search-input" value="search" disabled="disabled">
<input type="reset" id="reset-button" value="reset" disabled="disabled">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.rex</a></div>
<h1 title="Class RexProgramBuilder" class="title">Class RexProgramBuilder</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
<div class="inheritance">org.apache.calcite.rex.RexProgramBuilder</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">RexProgramBuilder</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="block">Workspace for constructing a <a href="RexProgram.html" title="class in org.apache.calcite.rex"><code>RexProgram</code></a>.
<p>RexProgramBuilder is necessary because a <a href="RexProgram.html" title="class in org.apache.calcite.rex"><code>RexProgram</code></a> is immutable.
(The <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link"><code>String</code></a> class has the same problem: it is immutable, so they
introduced <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/StringBuilder.html" title="class or interface in java.lang" class="external-link"><code>StringBuilder</code></a>.)</div>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexBuilder)" class="member-name-link">RexProgramBuilder</a><wbr>(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a program-builder that will not simplify.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button><button id="method-summary-table-tab6" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab6', 3)" class="table-tab">Deprecated Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addCondition(org.apache.calcite.rex.RexNode)" class="member-name-link">addCondition</a><wbr>(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the condition of the program.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addExpr(org.apache.calcite.rex.RexNode)" class="member-name-link">addExpr</a><wbr>(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds an expression to the list of common expressions, and returns a
reference to the expression.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addIdentity()" class="member-name-link">addIdentity</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds a project item for every input field.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addProject(int,int,java.lang.String)" class="member-name-link">addProject</a><wbr>(int&nbsp;at,
int&nbsp;ordinal,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds a projection based upon the <code>index</code>th expression at a
given position.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addProject(int,java.lang.String)" class="member-name-link">addProject</a><wbr>(int&nbsp;ordinal,
@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds a projection based upon the <code>index</code>th expression.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addProject(int,org.apache.calcite.rex.RexNode,java.lang.String)" class="member-name-link">addProject</a><wbr>(int&nbsp;at,
<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds a project expression to the program at a given position.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addProject(org.apache.calcite.rex.RexNode,java.lang.String)" class="member-name-link">addProject</a><wbr>(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr,
@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds a project expression to the program.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clearCondition()" class="member-name-link">clearCondition</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Clears the condition.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clearProjects()" class="member-name-link">clearProjects</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Removes all project items.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6"><code>static <a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#create(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.type.RelDataType,boolean)" class="member-name-link">create</a><wbr>(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectList,
@Nullable <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
boolean&nbsp;normalize)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6">
<div class="block"><span class="deprecated-label">Deprecated.</span></div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6"><code>static <a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#create(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.type.RelDataType,boolean,boolean)" class="member-name-link">create</a><wbr>(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectList,
@Nullable <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
boolean&nbsp;normalize,
boolean&nbsp;simplify_)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6">
<div class="block"><span class="deprecated-label">Deprecated.</span></div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.type.RelDataType,boolean,org.apache.calcite.rex.RexSimplify)" class="member-name-link">create</a><wbr>(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectList,
@Nullable <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
boolean&nbsp;normalize,
@Nullable <a href="RexSimplify.html" title="class in org.apache.calcite.rex">RexSimplify</a>&nbsp;simplify)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a program builder with the same contents as a program.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#create(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexLocalRef,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexShuttle,boolean)" class="member-name-link">create</a><wbr>(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;projectRefList,
@Nullable <a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&nbsp;conditionRef,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
<a href="RexShuttle.html" title="class in org.apache.calcite.rex">RexShuttle</a>&nbsp;shuttle,
boolean&nbsp;updateRefs)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a program builder with the same contents as a program, applying a
shuttle first.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#forProgram(org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexBuilder,boolean)" class="member-name-link">forProgram</a><wbr>(<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;program,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
boolean&nbsp;normalize)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Creates a program builder and initializes it from an existing program.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getInputRowType()" class="member-name-link">getInputRowType</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the row type of the input to the program.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getProgram()" class="member-name-link">getProgram</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Converts the state of the program builder to an immutable program,
normalizing in the process.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getProgram(boolean)" class="member-name-link">getProgram</a><wbr>(boolean&nbsp;normalize)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Converts the state of the program builder to an immutable program.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getProjectList()" class="member-name-link">getProjectList</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the list of project expressions.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#makeInputRef(int)" class="member-name-link">makeInputRef</a><wbr>(int&nbsp;index)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Creates a reference to a given input field.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#mergePrograms(org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexBuilder)" class="member-name-link">mergePrograms</a><wbr>(<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;topProgram,
<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;bottomProgram,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Merges two programs together, and normalizes the result.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#mergePrograms(org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexBuilder,boolean)" class="member-name-link">mergePrograms</a><wbr>(<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;topProgram,
<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;bottomProgram,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
boolean&nbsp;normalize)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Merges two programs together.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6"><code>static <a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6"><code><a href="#normalize(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexProgram)" class="member-name-link">normalize</a><wbr>(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;program)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4 method-summary-table-tab6">
<div class="block"><span class="deprecated-label">Deprecated.</span></div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#registerInput(org.apache.calcite.rex.RexNode)" class="member-name-link">registerInput</a><wbr>(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Registers an expression in the list of common sub-expressions, and
returns a reference to that expression.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#registerOutput(org.apache.calcite.rex.RexNode)" class="member-name-link">registerOutput</a><wbr>(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Converts an expression expressed in terms of the <em>outputs</em> of this
program into an expression expressed in terms of the <em>inputs</em>,
registers it in the list of common sub-expressions, and returns a
reference to that expression.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexBuilder)">
<h3>RexProgramBuilder</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">RexProgramBuilder</span><wbr><span class="parameters">(<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</span></div>
<div class="block">Creates a program-builder that will not simplify.</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="addProject(org.apache.calcite.rex.RexNode,java.lang.String)">
<h3>addProject</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="element-name">addProject</span><wbr><span class="parameters">(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr,
@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Adds a project expression to the program.
<p>The expression specified in terms of the input fields. If not, call
<a href="#registerOutput(org.apache.calcite.rex.RexNode)"><code>registerOutput(RexNode)</code></a> first.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>expr</code> - Expression to add</dd>
<dd><code>name</code> - Name of field in output row type; if null, a unique name will
be generated when the program is created</dd>
<dt>Returns:</dt>
<dd>the ref created</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addProject(int,java.lang.String)">
<h3>addProject</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="element-name">addProject</span><wbr><span class="parameters">(int&nbsp;ordinal,
@Nullable <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Adds a projection based upon the <code>index</code>th expression.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>ordinal</code> - Index of expression to project</dd>
<dd><code>name</code> - Name of field in output row type; if null, a unique name
will be generated when the program is created</dd>
<dt>Returns:</dt>
<dd>the ref created</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addProject(int,org.apache.calcite.rex.RexNode,java.lang.String)">
<h3>addProject</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="element-name">addProject</span><wbr><span class="parameters">(int&nbsp;at,
<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Adds a project expression to the program at a given position.
<p>The expression specified in terms of the input fields. If not, call
<a href="#registerOutput(org.apache.calcite.rex.RexNode)"><code>registerOutput(RexNode)</code></a> first.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>at</code> - Position in project list to add expression</dd>
<dd><code>expr</code> - Expression to add</dd>
<dd><code>name</code> - Name of field in output row type; if null, a unique name will
be generated when the program is created</dd>
<dt>Returns:</dt>
<dd>the ref created</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addProject(int,int,java.lang.String)">
<h3>addProject</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="element-name">addProject</span><wbr><span class="parameters">(int&nbsp;at,
int&nbsp;ordinal,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>&nbsp;name)</span></div>
<div class="block">Adds a projection based upon the <code>index</code>th expression at a
given position.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>at</code> - Position in project list to add expression</dd>
<dd><code>ordinal</code> - Index of expression to project</dd>
<dd><code>name</code> - Name of field in output row type; if null, a unique name
will be generated when the program is created</dd>
<dt>Returns:</dt>
<dd>the ref created</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addCondition(org.apache.calcite.rex.RexNode)">
<h3>addCondition</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">addCondition</span><wbr><span class="parameters">(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</span></div>
<div class="block">Sets the condition of the program.
<p>The expression must be specified in terms of the input fields. If
not, call <a href="#registerOutput(org.apache.calcite.rex.RexNode)"><code>registerOutput(RexNode)</code></a> first.</p></div>
</section>
</li>
<li>
<section class="detail" id="registerInput(org.apache.calcite.rex.RexNode)">
<h3>registerInput</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="element-name">registerInput</span><wbr><span class="parameters">(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</span></div>
<div class="block">Registers an expression in the list of common sub-expressions, and
returns a reference to that expression.
<p>The expression must be expressed in terms of the <em>inputs</em> of
this program.</p></div>
</section>
</li>
<li>
<section class="detail" id="registerOutput(org.apache.calcite.rex.RexNode)">
<h3>registerOutput</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="element-name">registerOutput</span><wbr><span class="parameters">(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</span></div>
<div class="block">Converts an expression expressed in terms of the <em>outputs</em> of this
program into an expression expressed in terms of the <em>inputs</em>,
registers it in the list of common sub-expressions, and returns a
reference to that expression.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>expr</code> - Expression to register</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addExpr(org.apache.calcite.rex.RexNode)">
<h3>addExpr</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="element-name">addExpr</span><wbr><span class="parameters">(<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;expr)</span></div>
<div class="block">Adds an expression to the list of common expressions, and returns a
reference to the expression. <b>DOES NOT CHECK WHETHER THE EXPRESSION
ALREADY EXISTS</b>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>expr</code> - Expression</dd>
<dt>Returns:</dt>
<dd>Reference to expression</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getProgram()">
<h3>getProgram</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="element-name">getProgram</span>()</div>
<div class="block">Converts the state of the program builder to an immutable program,
normalizing in the process.
<p>It is OK to call this method, modify the program specification (by
adding projections, and so forth), and call this method again.</div>
</section>
</li>
<li>
<section class="detail" id="getProgram(boolean)">
<h3>getProgram</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="element-name">getProgram</span><wbr><span class="parameters">(boolean&nbsp;normalize)</span></div>
<div class="block">Converts the state of the program builder to an immutable program.
<p>It is OK to call this method, modify the program specification (by
adding projections, and so forth), and call this method again.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>normalize</code> - Whether to normalize</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="forProgram(org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexBuilder,boolean)">
<h3>forProgram</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></span>&nbsp;<span class="element-name">forProgram</span><wbr><span class="parameters">(<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;program,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
boolean&nbsp;normalize)</span></div>
<div class="block">Creates a program builder and initializes it from an existing program.
<p>Calling <a href="#getProgram()"><code>getProgram()</code></a> immediately after creation will return a
program equivalent (in terms of external behavior) to the existing
program.
<p>The existing program will not be changed. (It cannot: programs are
immutable.)</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>program</code> - Existing program</dd>
<dd><code>rexBuilder</code> - Rex builder</dd>
<dd><code>normalize</code> - Whether to normalize</dd>
<dt>Returns:</dt>
<dd>A program builder initialized with an equivalent program</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="create(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.type.RelDataType,boolean,org.apache.calcite.rex.RexSimplify)">
<h3>create</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></span>&nbsp;<span class="element-name">create</span><wbr><span class="parameters">(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectList,
@Nullable <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
boolean&nbsp;normalize,
@Nullable <a href="RexSimplify.html" title="class in org.apache.calcite.rex">RexSimplify</a>&nbsp;simplify)</span></div>
<div class="block">Creates a program builder with the same contents as a program.
<p>If <code>normalize</code>, converts the program to canonical form. In
canonical form, in addition to the usual constraints:
<ul>
<li>The first N internal expressions are <a href="RexInputRef.html" title="class in org.apache.calcite.rex"><code>RexInputRef</code></a>s to the N
input fields;
<li>Subsequent internal expressions reference only preceding expressions;
<li>Arguments to <a href="RexCall.html" title="class in org.apache.calcite.rex"><code>RexCall</code></a>s must be <a href="RexLocalRef.html" title="class in org.apache.calcite.rex"><code>RexLocalRef</code></a>s (that is,
expressions must have maximum depth 1)
</ul>
<p>there are additional constraints:
<ul>
<li>Expressions appear in the left-deep order they are needed by
the projections and (if present) the condition. Thus, expression N+1
is the leftmost argument (literal or or call) in the expansion of
projection #0.
<li>There are no duplicate expressions
<li>There are no unused expressions
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rexBuilder</code> - Rex builder</dd>
<dd><code>inputRowType</code> - Input row type</dd>
<dd><code>exprList</code> - Common expressions</dd>
<dd><code>projectList</code> - Projections</dd>
<dd><code>condition</code> - Condition, or null</dd>
<dd><code>outputRowType</code> - Output row type</dd>
<dd><code>normalize</code> - Whether to normalize</dd>
<dd><code>simplify</code> - Whether to simplify expressions</dd>
<dt>Returns:</dt>
<dd>A program builder</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="create(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.type.RelDataType,boolean,boolean)">
<h3>create</h3>
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
</span><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></span>&nbsp;<span class="element-name">create</span><wbr><span class="parameters">(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectList,
@Nullable <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
boolean&nbsp;normalize,
boolean&nbsp;simplify_)</span></div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span></div>
</section>
</li>
<li>
<section class="detail" id="create(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.type.RelDataType,boolean)">
<h3>create</h3>
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
</span><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></span>&nbsp;<span class="element-name">create</span><wbr><span class="parameters">(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;? extends <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;projectList,
@Nullable <a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
boolean&nbsp;normalize)</span></div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span></div>
</section>
</li>
<li>
<section class="detail" id="create(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rel.type.RelDataType,java.util.List,java.util.List,org.apache.calcite.rex.RexLocalRef,org.apache.calcite.rel.type.RelDataType,org.apache.calcite.rex.RexShuttle,boolean)">
<h3>create</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="RexProgramBuilder.html" title="class in org.apache.calcite.rex">RexProgramBuilder</a></span>&nbsp;<span class="element-name">create</span><wbr><span class="parameters">(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;inputRowType,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;exprList,
<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;&nbsp;projectRefList,
@Nullable <a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&nbsp;conditionRef,
<a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a>&nbsp;outputRowType,
<a href="RexShuttle.html" title="class in org.apache.calcite.rex">RexShuttle</a>&nbsp;shuttle,
boolean&nbsp;updateRefs)</span></div>
<div class="block">Creates a program builder with the same contents as a program, applying a
shuttle first.
<p>TODO: Refactor the above create method in terms of this one.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>rexBuilder</code> - Rex builder</dd>
<dd><code>inputRowType</code> - Input row type</dd>
<dd><code>exprList</code> - Common expressions</dd>
<dd><code>projectRefList</code> - Projections</dd>
<dd><code>conditionRef</code> - Condition, or null</dd>
<dd><code>outputRowType</code> - Output row type</dd>
<dd><code>shuttle</code> - Shuttle to apply to each expression before adding it
to the program builder</dd>
<dd><code>updateRefs</code> - Whether to update references that changes as a result
of rewrites made by the shuttle</dd>
<dt>Returns:</dt>
<dd>A program builder</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="normalize(org.apache.calcite.rex.RexBuilder,org.apache.calcite.rex.RexProgram)">
<h3>normalize</h3>
<div class="member-signature"><span class="annotations"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Deprecated.html" title="class or interface in java.lang" class="external-link">@Deprecated</a>
</span><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="element-name">normalize</span><wbr><span class="parameters">(<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;program)</span></div>
<div class="deprecation-block"><span class="deprecated-label">Deprecated.</span></div>
</section>
</li>
<li>
<section class="detail" id="mergePrograms(org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexBuilder)">
<h3>mergePrograms</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="element-name">mergePrograms</span><wbr><span class="parameters">(<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;topProgram,
<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;bottomProgram,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</span></div>
<div class="block">Merges two programs together, and normalizes the result.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>topProgram</code> - Top program. Its expressions are in terms of the
outputs of the bottom program.</dd>
<dd><code>bottomProgram</code> - Bottom program. Its expressions are in terms of the
result fields of the relational expression's input</dd>
<dd><code>rexBuilder</code> - Rex builder</dd>
<dt>Returns:</dt>
<dd>Merged program</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="#mergePrograms(org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexBuilder,boolean)"><code>mergePrograms(RexProgram, RexProgram, RexBuilder, boolean)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="mergePrograms(org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexProgram,org.apache.calcite.rex.RexBuilder,boolean)">
<h3>mergePrograms</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a></span>&nbsp;<span class="element-name">mergePrograms</span><wbr><span class="parameters">(<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;topProgram,
<a href="RexProgram.html" title="class in org.apache.calcite.rex">RexProgram</a>&nbsp;bottomProgram,
<a href="RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder,
boolean&nbsp;normalize)</span></div>
<div class="block">Merges two programs together.
<p>All expressions become common sub-expressions. For example, the query
<blockquote><pre>SELECT x + 1 AS p, x + y AS q FROM (
SELECT a + b AS x, c AS y
FROM t
WHERE c = 6)}</pre></blockquote>
<p>would be represented as the programs
<blockquote><pre>
Calc:
Projects={$2, $3},
Condition=null,
Exprs={$0, $1, $0 + 1, $0 + $1})
Calc(
Projects={$3, $2},
Condition={$4}
Exprs={$0, $1, $2, $0 + $1, $2 = 6}
</pre></blockquote>
<p>The merged program is
<blockquote><pre>
Calc(
Projects={$4, $5}
Condition=$6
Exprs={0: $0 // a
1: $1 // b
2: $2 // c
3: ($0 + $1) // x = a + b
4: ($3 + 1) // p = x + 1
5: ($3 + $2) // q = x + y
6: ($2 = 6) // c = 6
</pre></blockquote>
<p>Another example:</p>
<blockquote>
<pre>SELECT *
FROM (
SELECT a + b AS x, c AS y
FROM t
WHERE c = 6)
WHERE x = 5</pre>
</blockquote>
<p>becomes
<blockquote>
<pre>SELECT a + b AS x, c AS y
FROM t
WHERE c = 6 AND (a + b) = 5</pre>
</blockquote></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>topProgram</code> - Top program. Its expressions are in terms of the
outputs of the bottom program.</dd>
<dd><code>bottomProgram</code> - Bottom program. Its expressions are in terms of the
result fields of the relational expression's input</dd>
<dd><code>rexBuilder</code> - Rex builder</dd>
<dd><code>normalize</code> - Whether to convert program to canonical form</dd>
<dt>Returns:</dt>
<dd>Merged program</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="clearProjects()">
<h3>clearProjects</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">clearProjects</span>()</div>
<div class="block">Removes all project items.
<p>After calling this method, you may need to re-normalize.</p></div>
</section>
</li>
<li>
<section class="detail" id="clearCondition()">
<h3>clearCondition</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">clearCondition</span>()</div>
<div class="block">Clears the condition.
<p>After calling this method, you may need to re-normalize.</p></div>
</section>
</li>
<li>
<section class="detail" id="addIdentity()">
<h3>addIdentity</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">addIdentity</span>()</div>
<div class="block">Adds a project item for every input field.
<p>You cannot call this method if there are other project items.</div>
</section>
</li>
<li>
<section class="detail" id="makeInputRef(int)">
<h3>makeInputRef</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a></span>&nbsp;<span class="element-name">makeInputRef</span><wbr><span class="parameters">(int&nbsp;index)</span></div>
<div class="block">Creates a reference to a given input field.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - Ordinal of input field, must be less than the number of
fields in the input type</dd>
<dt>Returns:</dt>
<dd>Reference to input field</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getInputRowType()">
<h3>getInputRowType</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../rel/type/RelDataType.html" title="interface in org.apache.calcite.rel.type">RelDataType</a></span>&nbsp;<span class="element-name">getInputRowType</span>()</div>
<div class="block">Returns the row type of the input to the program.</div>
</section>
</li>
<li>
<section class="detail" id="getProjectList()">
<h3>getProjectList</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a>&lt;<a href="RexLocalRef.html" title="class in org.apache.calcite.rex">RexLocalRef</a>&gt;</span>&nbsp;<span class="element-name">getProjectList</span>()</div>
<div class="block">Returns the list of project expressions.</div>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &copy; 2012-2023 Apache Software Foundation. All Rights Reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>