| <!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"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="SubstitutionVisitor (Apache Calcite calcite API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| 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 = "../../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="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"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </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> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.apache.calcite.plan</a></div> |
| <h2 title="Class SubstitutionVisitor" class="title">Class SubstitutionVisitor</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><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></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.calcite.plan.SubstitutionVisitor</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <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> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== NESTED CLASS SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Class</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>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> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Field</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>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> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Constructor</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.calcite.rel.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> |
| </table> |
| </li> |
| </ul> |
| </section> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Method</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>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 id="i1" class="rowColor"> |
| <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 id="i2" class="altColor"> |
| <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 id="i3" class="rowColor"> |
| <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 id="i4" class="altColor"> |
| <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 id="i5" class="rowColor"> |
| <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 id="i6" class="altColor"> |
| <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 id="i7" class="rowColor"> |
| <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 id="i8" class="altColor"> |
| <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 id="i9" class="rowColor"> |
| <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> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <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> |
| <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></li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a id="DEFAULT_RULES"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>DEFAULT_RULES</h4> |
| <pre>protected static final com.google.common.collect.ImmutableList<<a href="SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> DEFAULT_RULES</pre> |
| </li> |
| </ul> |
| <a id="relBuilder"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>relBuilder</h4> |
| <pre>protected final <a href="../tools/RelBuilder.html" title="class in org.apache.calcite.tools">RelBuilder</a> relBuilder</pre> |
| <div class="block">Factory for a builder for relational expressions.</div> |
| </li> |
| </ul> |
| <a id="slots"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>slots</h4> |
| <pre>protected final <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a>[] slots</pre> |
| <div class="block">Workspace while rule is being matched. |
| Careful, re-entrant! |
| Assumes no rule needs more than 2 slots.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a id="<init>(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SubstitutionVisitor</h4> |
| <pre>public SubstitutionVisitor​(<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_)</pre> |
| <div class="block">Creates a SubstitutionVisitor with the default rule set.</div> |
| </li> |
| </ul> |
| <a id="<init>(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,com.google.common.collect.ImmutableList)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>SubstitutionVisitor</h4> |
| <pre>public SubstitutionVisitor​(<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)</pre> |
| <div class="block">Creates a SubstitutionVisitor with the default logical builder.</div> |
| </li> |
| </ul> |
| <a id="<init>(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,com.google.common.collect.ImmutableList,org.apache.calcite.tools.RelBuilderFactory)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>SubstitutionVisitor</h4> |
| <pre>public SubstitutionVisitor​(<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)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| <!-- ============ METHOD DETAIL ========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a id="splitFilter(org.apache.calcite.rex.RexSimplify,org.apache.calcite.rex.RexNode,org.apache.calcite.rex.RexNode)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>splitFilter</h4> |
| <pre class="methodSignature">public static <a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> splitFilter​(<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)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="mayBeSatisfiable(org.apache.calcite.rex.RexNode)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>mayBeSatisfiable</h4> |
| <pre class="methodSignature">public static boolean mayBeSatisfiable​(<a href="../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> e)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="go0(org.apache.calcite.rel.RelNode)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>go0</h4> |
| <pre class="methodSignature">public <a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> go0​(<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</pre> |
| </li> |
| </ul> |
| <a id="go(org.apache.calcite.rel.RelNode)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>go</h4> |
| <pre class="methodSignature">public <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>> go​(<a href="../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="replace(org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>replace</h4> |
| <pre class="methodSignature">public static org.apache.calcite.plan.SubstitutionVisitor.Replacement replace​(<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)</pre> |
| <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> |
| </li> |
| </ul> |
| <a id="permute(org.apache.calcite.rel.mutable.MutableAggregate,org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.util.mapping.Mapping)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>permute</h4> |
| <pre class="methodSignature">public static <a href="../rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> permute​(<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)</pre> |
| </li> |
| </ul> |
| <a id="unifyAggregates(org.apache.calcite.rel.mutable.MutableAggregate,org.apache.calcite.rex.RexNode,org.apache.calcite.rel.mutable.MutableAggregate)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>unifyAggregates</h4> |
| <pre class="methodSignature">public static <a href="../rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> unifyAggregates​(<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)</pre> |
| </li> |
| </ul> |
| <a id="getRollup(org.apache.calcite.sql.SqlAggFunction)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getRollup</h4> |
| <pre class="methodSignature">public static <a href="../sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a> getRollup​(<a href="../sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a> aggregation)</pre> |
| </li> |
| </ul> |
| <a id="isWeaker(org.apache.calcite.rel.mutable.MutableRel,org.apache.calcite.rel.mutable.MutableRel)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isWeaker</h4> |
| <pre class="methodSignature">protected boolean isWeaker​(<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)</pre> |
| <div class="block">Returns if one rel is weaker than another.</div> |
| </li> |
| </ul> |
| <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)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>equalType</h4> |
| <pre class="methodSignature">public static boolean equalType​(<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)</pre> |
| <div class="block">Returns whether two relational expressions have the same row-type.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="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"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </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> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small>Copyright © 2012-2020 Apache Software Foundation. All Rights Reserved.</small></p> |
| </footer> |
| </body> |
| </html> |