| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <title>SubstitutionVisitor (Apache Calcite calcite API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.calcite.plan, class: SubstitutionVisitor"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../script-dir/jquery-3.4.1.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-ui.js"></script> |
| </head> |
| <body class="class-declaration"> |
| <script type="text/javascript">var data = {"i0":9,"i1":9,"i2":10,"i3":10,"i4":10,"i5":9,"i6":9,"i7":9,"i8":9,"i9":9}; |
| var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| var pathtoroot = "../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flexBox"> |
| <header role="banner" class="flexHeader"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><b>Apache Calcite</b></div> |
| </div> |
| <div class="subNav"> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="navListSearch"><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <div class="skipNav"><a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| </nav> |
| </header> |
| <div class="flexContent"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.calcite.plan</a></div> |
| <h1 title="Class SubstitutionVisitor" class="title">Class SubstitutionVisitor</h1> |
| </div> |
| <div class="contentContainer"> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a> |
| <div class="inheritance">org.apache.calcite.plan.SubstitutionVisitor</div> |
| </div> |
| <section class="description"> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><code><a href="MaterializedViewSubstitutionVisitor.html" title="class in org.apache.calcite.plan">MaterializedViewSubstitutionVisitor</a></code></dd> |
| </dl> |
| <hr> |
| <pre>public class <span class="typeNameLabel">SubstitutionVisitor</span> |
| extends <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></pre> |
| <div class="block">Substitutes part of a tree of relational expressions with another tree. |
| |
| <p>The call <code>new SubstitutionVisitor(target, query).go(replacement))</code> |
| will return <code>query</code> with every occurrence of <code>target</code> replaced |
| by <code>replacement</code>.</p> |
| |
| <p>The following example shows how <code>SubstitutionVisitor</code> can be used |
| for materialized view recognition.</p> |
| |
| <ul> |
| <li>query = SELECT a, c FROM t WHERE x = 5 AND b = 4</li> |
| <li>target = SELECT a, b, c FROM t WHERE x = 5</li> |
| <li>replacement = SELECT * FROM mv</li> |
| <li>result = SELECT a, c FROM mv WHERE b = 4</li> |
| </ul> |
| |
| <p>Note that <code>result</code> uses the materialized view table <code>mv</code> and a |
| simplified condition <code>b = 4</code>.</p> |
| |
| <p>Uses a bottom-up matching algorithm. Nodes do not need to be identical. |
| At each level, returns the residue.</p> |
| |
| <p>The inputs must only include the core relational operators: |
| <a href="../rel/core/TableScan.html" title="class in org.apache.calcite.rel.core"><code>TableScan</code></a>, |
| <a href="../rel/core/Filter.html" title="class in org.apache.calcite.rel.core"><code>Filter</code></a>, |
| <a href="../rel/core/Project.html" title="class in org.apache.calcite.rel.core"><code>Project</code></a>, |
| <a href="../rel/core/Calc.html" title="class in org.apache.calcite.rel.core"><code>Calc</code></a>, |
| <a href="../rel/core/Join.html" title="class in org.apache.calcite.rel.core"><code>Join</code></a>, |
| <a href="../rel/core/Union.html" title="class in org.apache.calcite.rel.core"><code>Union</code></a>, |
| <a href="../rel/core/Intersect.html" title="class in org.apache.calcite.rel.core"><code>Intersect</code></a>, |
| <a href="../rel/core/Aggregate.html" title="class in org.apache.calcite.rel.core"><code>Aggregate</code></a>.</p></div> |
| </section> |
| <section class="summary"> |
| <ul class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <li class="blockList"> |
| <section class="nestedClassSummary"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h2>Nested Class Summary</h2> |
| <div class="memberSummary"> |
| <table> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <thead> |
| <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> |
| </thead> |
| <tbody> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SubstitutionVisitor.AbstractUnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.AbstractUnifyRule</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Abstract base class for implementing <a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan"><code>SubstitutionVisitor.UnifyRule</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SubstitutionVisitor.MatchFailed.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.MatchFailed</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Exception thrown to exit a matcher.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SubstitutionVisitor.Operand.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.Operand</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Operand to a <a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan"><code>SubstitutionVisitor.UnifyRule</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SubstitutionVisitor.UnifyResult.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyResult</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Result of an application of a <a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan"><code>SubstitutionVisitor.UnifyRule</code></a> indicating that the |
| rule successfully matched <code>query</code> against <code>target</code> and |
| generated a <code>result</code> that is equivalent to <code>query</code> and |
| contains <code>target</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Rule that attempts to match a query relational expression |
| against a target relational expression.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected class </code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="SubstitutionVisitor.UnifyRuleCall.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRuleCall</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Arguments to an application of a <a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan"><code>SubstitutionVisitor.UnifyRule</code></a>.</div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </section> |
| </li> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li class="blockList"> |
| <section class="fieldSummary"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h2>Field Summary</h2> |
| <div class="memberSummary"> |
| <table> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <thead> |
| <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> |
| </thead> |
| <tbody> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static com.google.common.collect.ImmutableList<<a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DEFAULT_RULES">DEFAULT_RULES</a></span></code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../tools/RelBuilder.html" title="class in org.apache.calcite.tools">RelBuilder</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#relBuilder">relBuilder</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Factory for a builder for relational expressions.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a>[]</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#slots">slots</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Workspace while rule is being matched.</div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </section> |
| </li> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li class="blockList"> |
| <section class="constructorSummary"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h2>Constructor Summary</h2> |
| <div class="memberSummary"> |
| <table> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <thead> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode)">SubstitutionVisitor</a></span>​(<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a SubstitutionVisitor with the default rule set.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,com.google.common.collect.ImmutableList)">SubstitutionVisitor</a></span>​(<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_, |
| com.google.common.collect.ImmutableList<<a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> rules)</code></th> |
| <td class="colLast"> |
| <div class="block">Creates a SubstitutionVisitor with the default logical builder.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,com.google.common.collect.ImmutableList,org.apache.calcite.tools.RelBuilderFactory)">SubstitutionVisitor</a></span>​(<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_, |
| com.google.common.collect.ImmutableList<<a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> rules, |
| <a href="../tools/RelBuilderFactory.html" title="interface in org.apache.calcite.tools">RelBuilderFactory</a> relBuilderFactory)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li class="blockList"> |
| <section class="methodSummary"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h2>Method Summary</h2> |
| <div class="memberSummary"> |
| <div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t1" class="tableTab" onclick="show(1);">Static Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button></div> |
| <div id="memberSummary_tabpanel" role="tabpanel"> |
| <table aria-labelledby="t0"> |
| <thead> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr class="altColor" id="i0"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equalType(java.lang.String,org.apache.calcite.rel.mutable.MutableRel,java.lang.String,org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.util.Litmus)">equalType</a></span>​(<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> desc0, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel0, |
| <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> desc1, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel1, |
| <a href="../util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a> litmus)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns whether two relational expressions have the same row-type.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i1"> |
| <td class="colFirst"><code>static <a href="../sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getRollup(org.apache.calcite.sql.SqlAggFunction)">getRollup</a></span>​(<a href="../sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a> aggregation)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor" id="i2"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#go(org.apache.calcite.rel.RelNode)">go</a></span>​(<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns a list of all possible rels that result from substituting the |
| matched RelNode with the replacement RelNode within the query.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i3"> |
| <td class="colFirst"><code><a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#go0(org.apache.calcite.rel.RelNode)">go0</a></span>​(<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="altColor" id="i4"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isWeaker(org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel)">isWeaker</a></span>​(<a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel0, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns if one rel is weaker than another.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i5"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#mayBeSatisfiable(org.apache.calcite.rex.RexNode)">mayBeSatisfiable</a></span>​(<a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> e)</code></th> |
| <td class="colLast"> |
| <div class="block">Returns whether a boolean expression ever returns true.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i6"> |
| <td class="colFirst"><code>static <a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#permute(org.apache.calcite.rel.mutable.MutableAggregate,org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.util.mapping.Mapping)">permute</a></span>​(<a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> aggregate, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> input, |
| <a href="../util/mapping/Mapping.html" title="interface in org.apache.calcite.util.mapping">Mapping</a> mapping)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| <tr class="rowColor" id="i7"> |
| <td class="colFirst"><code>static org.apache.calcite.plan.SubstitutionVisitor.Replacement</code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#replace(org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel)">replace</a></span>​(<a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> query, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> find, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> replace)</code></th> |
| <td class="colLast"> |
| <div class="block">Within a relational expression <code>query</code>, replaces occurrences of |
| <code>find</code> with <code>replace</code>.</div> |
| </td> |
| </tr> |
| <tr class="altColor" id="i8"> |
| <td class="colFirst"><code>static <a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#splitFilter(org.apache.calcite.rex.RexSimplify,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)">splitFilter</a></span>​(<a href="../rex/RexSimplify.html" title="class in org.apache.calcite.rex">RexSimplify</a> simplify, |
| <a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> condition, |
| <a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> target)</code></th> |
| <td class="colLast"> |
| <div class="block">Maps a condition onto a target.</div> |
| </td> |
| </tr> |
| <tr class="rowColor" id="i9"> |
| <td class="colFirst"><code>static <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#unifyAggregates(org.apache.calcite.rel.mutable.MutableAggregate,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.mutable.MutableAggregate)">unifyAggregates</a></span>​(<a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> query, |
| <a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> targetCond, |
| <a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> target)</code></th> |
| <td class="colLast"> </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="inheritedList"> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3> |
| <a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a><code><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <li class="blockList"> |
| <section class="fieldDetails"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h2>Field Details</h2> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="DEFAULT_RULES">DEFAULT_RULES</a></h3> |
| <div class="memberSignature"><span class="modifiers">protected static final</span> <span class="returnType">com.google.common.collect.ImmutableList<<a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>></span> <span class="memberName">DEFAULT_RULES</span></div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="relBuilder">relBuilder</a></h3> |
| <div class="memberSignature"><span class="modifiers">protected final</span> <span class="returnType"><a href="../tools/RelBuilder.html" title="class in org.apache.calcite.tools">RelBuilder</a></span> <span class="memberName">relBuilder</span></div> |
| <div class="block">Factory for a builder for relational expressions.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="slots">slots</a></h3> |
| <div class="memberSignature"><span class="modifiers">protected final</span> <span class="returnType"><a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a>[]</span> <span class="memberName">slots</span></div> |
| <div class="block">Workspace while rule is being matched. |
| Careful, re-entrant! |
| Assumes no rule needs more than 2 slots.</div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li class="blockList"> |
| <section class="constructorDetails"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h2>Constructor Details</h2> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="<init>(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode)">SubstitutionVisitor</a></h3> |
| <div class="memberSignature"><span class="modifiers">public</span> <span class="memberName">SubstitutionVisitor</span>​(<span class="arguments"><a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_)</span></div> |
| <div class="block">Creates a SubstitutionVisitor with the default rule set.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="<init>(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,com.google.common.collect.ImmutableList)">SubstitutionVisitor</a></h3> |
| <div class="memberSignature"><span class="modifiers">public</span> <span class="memberName">SubstitutionVisitor</span>​(<span class="arguments"><a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_, |
| com.google.common.collect.ImmutableList<<a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> rules)</span></div> |
| <div class="block">Creates a SubstitutionVisitor with the default logical builder.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="<init>(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,com.google.common.collect.ImmutableList,org.apache.calcite.tools.RelBuilderFactory)">SubstitutionVisitor</a></h3> |
| <div class="memberSignature"><span class="modifiers">public</span> <span class="memberName">SubstitutionVisitor</span>​(<span class="arguments"><a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_, |
| com.google.common.collect.ImmutableList<<a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> rules, |
| <a href="../tools/RelBuilderFactory.html" title="interface in org.apache.calcite.tools">RelBuilderFactory</a> relBuilderFactory)</span></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li class="blockList"> |
| <section class="methodDetails"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h2>Method Details</h2> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="splitFilter(org.apache.calcite.rex.RexSimplify,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)">splitFilter</a></h3> |
| <div class="memberSignature"><span class="modifiers">public static</span> <span class="returnType"><a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></span> <span class="memberName">splitFilter</span>​(<span class="arguments"><a href="../rex/RexSimplify.html" title="class in org.apache.calcite.rex">RexSimplify</a> simplify, |
| <a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> condition, |
| <a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> target)</span></div> |
| <div class="block">Maps a condition onto a target. |
| |
| <p>If condition is stronger than target, returns the residue. |
| If it is equal to target, returns the expression that evaluates to |
| the constant <code>true</code>. If it is weaker than target, returns |
| <code>null</code>.</p> |
| |
| <p>The terms satisfy the relation</p> |
| |
| <blockquote> |
| <pre><code>condition = target AND residue</code></pre> |
| </blockquote> |
| |
| <p>and <code>residue</code> must be as weak as possible.</p> |
| |
| <p>Example #1: condition stronger than target</p> |
| <ul> |
| <li>condition: x = 1 AND y = 2</li> |
| <li>target: x = 1</li> |
| <li>residue: y = 2</li> |
| </ul> |
| |
| <p>Note that residue <code>x &gt; 0 AND y = 2</code> would also satisfy the |
| relation <code>condition = target AND residue</code> but is stronger than |
| necessary, so we prefer <code>y = 2</code>.</p> |
| |
| <p>Example #2: target weaker than condition (valid, but not currently |
| implemented)</p> |
| <ul> |
| <li>condition: x = 1</li> |
| <li>target: x = 1 OR z = 3</li> |
| <li>residue: x = 1</li> |
| </ul> |
| |
| <p>Example #3: condition and target are equivalent</p> |
| <ul> |
| <li>condition: x = 1 AND y = 2</li> |
| <li>target: y = 2 AND x = 1</li> |
| <li>residue: TRUE</li> |
| </ul> |
| |
| <p>Example #4: condition weaker than target</p> |
| <ul> |
| <li>condition: x = 1</li> |
| <li>target: x = 1 AND y = 2</li> |
| <li>residue: null (i.e. no match)</li> |
| </ul> |
| |
| <p>There are many other possible examples. It amounts to solving |
| whether <code>condition AND NOT target</code> can ever evaluate to |
| true, and therefore is a form of the NP-complete |
| <a href="http://en.wikipedia.org/wiki/Satisfiability">Satisfiability</a> |
| problem.</p></div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="mayBeSatisfiable(org.apache.calcite.rex.RexNode)">mayBeSatisfiable</a></h3> |
| <div class="memberSignature"><span class="modifiers">public static</span> <span class="returnType">boolean</span> <span class="memberName">mayBeSatisfiable</span>​(<span class="arguments"><a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> e)</span></div> |
| <div class="block">Returns whether a boolean expression ever returns true. |
| |
| <p>This method may give false positives. For instance, it will say |
| that <code>x = 5 AND x > 10</code> is satisfiable, because at present it |
| cannot prove that it is not.</p></div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="go0(org.apache.calcite.rel.RelNode)">go0</a></h3> |
| <div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a></span> <span class="memberName">go0</span>​(<span class="arguments"><a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</span></div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="go(org.apache.calcite.rel.RelNode)">go</a></h3> |
| <div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="https://docs.oracle.com/javase/9/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util" class="externalLink">List</a><<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>></span> <span class="memberName">go</span>​(<span class="arguments"><a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</span></div> |
| <div class="block">Returns a list of all possible rels that result from substituting the |
| matched RelNode with the replacement RelNode within the query. |
| |
| <p>For example, the substitution result of A join B, while A and B |
| are both a qualified match for replacement R, is R join B, R join R, |
| A join R.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="replace(org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel)">replace</a></h3> |
| <div class="memberSignature"><span class="modifiers">public static</span> <span class="returnType">org.apache.calcite.plan.SubstitutionVisitor.Replacement</span> <span class="memberName">replace</span>​(<span class="arguments"><a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> query, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> find, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> replace)</span></div> |
| <div class="block">Within a relational expression <code>query</code>, replaces occurrences of |
| <code>find</code> with <code>replace</code>. |
| |
| <p>Assumes relational expressions (and their descendants) are not null. |
| Does not handle cycles.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="permute(org.apache.calcite.rel.mutable.MutableAggregate,org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.util.mapping.Mapping)">permute</a></h3> |
| <div class="memberSignature"><span class="modifiers">public static</span> <span class="returnType"><a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a></span> <span class="memberName">permute</span>​(<span class="arguments"><a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> aggregate, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> input, |
| <a href="../util/mapping/Mapping.html" title="interface in org.apache.calcite.util.mapping">Mapping</a> mapping)</span></div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="unifyAggregates(org.apache.calcite.rel.mutable.MutableAggregate,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.mutable.MutableAggregate)">unifyAggregates</a></h3> |
| <div class="memberSignature"><span class="modifiers">public static</span> <span class="returnType"><a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a></span> <span class="memberName">unifyAggregates</span>​(<span class="arguments"><a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> query, |
| <a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> targetCond, |
| <a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> target)</span></div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="getRollup(org.apache.calcite.sql.SqlAggFunction)">getRollup</a></h3> |
| <div class="memberSignature"><span class="modifiers">public static</span> <span class="returnType"><a href="../sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a></span> <span class="memberName">getRollup</span>​(<span class="arguments"><a href="../sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a> aggregation)</span></div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="isWeaker(org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel)">isWeaker</a></h3> |
| <div class="memberSignature"><span class="modifiers">protected</span> <span class="returnType">boolean</span> <span class="memberName">isWeaker</span>​(<span class="arguments"><a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel0, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel)</span></div> |
| <div class="block">Returns if one rel is weaker than another.</div> |
| </section> |
| </li> |
| <li class="blockList"> |
| <section class="detail"> |
| <h3><a id="equalType(java.lang.String,org.apache.calcite.rel.mutable.MutableRel,java.lang.String,org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.util.Litmus)">equalType</a></h3> |
| <div class="memberSignature"><span class="modifiers">public static</span> <span class="returnType">boolean</span> <span class="memberName">equalType</span>​(<span class="arguments"><a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> desc0, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel0, |
| <a href="https://docs.oracle.com/javase/9/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> desc1, |
| <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel1, |
| <a href="../util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a> litmus)</span></div> |
| <div class="block">Returns whether two relational expressions have the same row-type.</div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| <div class="aboutLanguage"><b>Apache Calcite</b></div> |
| </div> |
| <div class="subNav"> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li><a href="#nested.class.summary">Nested</a> | </li> |
| <li><a href="#field.summary">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field.detail">Field</a> | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2012-2020 Apache Software Foundation. All Rights Reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |