| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>SubstitutionVisitor (Apache Calcite calcite API)</title> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.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 methods = {"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"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.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"> |
| <li><a href="../../../../org/apache/calcite/plan/Strong.Policy.html" title="enum in org.apache.calcite.plan"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.AbstractUnifyRule.html" title="class in org.apache.calcite.plan"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/calcite/plan/SubstitutionVisitor.html" target="_top">Frames</a></li> |
| <li><a href="SubstitutionVisitor.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></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> |
| </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 name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.calcite.plan</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/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">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><a href="../../../../org/apache/calcite/plan/MaterializedViewSubstitutionVisitor.html" title="class in org.apache.calcite.plan">MaterializedViewSubstitutionVisitor</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public class <span class="typeNameLabel">SubstitutionVisitor</span> |
| extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">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="../../../../org/apache/calcite/rel/core/TableScan.html" title="class in org.apache.calcite.rel.core"><code>TableScan</code></a>, |
| <a href="../../../../org/apache/calcite/rel/core/Filter.html" title="class in org.apache.calcite.rel.core"><code>Filter</code></a>, |
| <a href="../../../../org/apache/calcite/rel/core/Project.html" title="class in org.apache.calcite.rel.core"><code>Project</code></a>, |
| <a href="../../../../org/apache/calcite/rel/core/Calc.html" title="class in org.apache.calcite.rel.core"><code>Calc</code></a>, |
| <a href="../../../../org/apache/calcite/rel/core/Join.html" title="class in org.apache.calcite.rel.core"><code>Join</code></a>, |
| <a href="../../../../org/apache/calcite/rel/core/Union.html" title="class in org.apache.calcite.rel.core"><code>Union</code></a>, |
| <a href="../../../../org/apache/calcite/rel/core/Intersect.html" title="class in org.apache.calcite.rel.core"><code>Intersect</code></a>, |
| <a href="../../../../org/apache/calcite/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 ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="nested.class.summary"> |
| <!-- --> |
| </a> |
| <h3>Nested Class Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> |
| <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Class and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static class </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.AbstractUnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.AbstractUnifyRule</a></span></code> |
| <div class="block">Abstract base class for implementing <a href="../../../../org/apache/calcite/plan/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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.MatchFailed.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.MatchFailed</a></span></code> |
| <div class="block">Exception thrown to exit a matcher.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static class </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.Operand.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.Operand</a></span></code> |
| <div class="block">Operand to a <a href="../../../../org/apache/calcite/plan/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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyResult.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyResult</a></span></code> |
| <div class="block">Result of an application of a <a href="../../../../org/apache/calcite/plan/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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a></span></code> |
| <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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyRuleCall.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRuleCall</a></span></code> |
| <div class="block">Arguments to an application of a <a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan"><code>SubstitutionVisitor.UnifyRule</code></a>.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected static com.google.common.collect.ImmutableList<<a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#DEFAULT_RULES">DEFAULT_RULES</a></span></code> </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>protected <a href="../../../../org/apache/calcite/tools/RelBuilder.html" title="class in org.apache.calcite.tools">RelBuilder</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#relBuilder">relBuilder</a></span></code> |
| <div class="block">Factory for a builder for relational expressions.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a>[]</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#slots">slots</a></span></code> |
| <div class="block">Workspace while rule is being matched.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#SubstitutionVisitor-org.apache.calcite.rel.RelNode-org.apache.calcite.rel.RelNode-">SubstitutionVisitor</a></span>(<a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_)</code> |
| <div class="block">Creates a SubstitutionVisitor with the default rule set.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#SubstitutionVisitor-org.apache.calcite.rel.RelNode-org.apache.calcite.rel.RelNode-com.google.common.collect.ImmutableList-">SubstitutionVisitor</a></span>(<a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_, |
| com.google.common.collect.ImmutableList<<a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> rules)</code> |
| <div class="block">Creates a SubstitutionVisitor with the default logical builder.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#SubstitutionVisitor-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="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_, |
| com.google.common.collect.ImmutableList<<a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> rules, |
| <a href="../../../../org/apache/calcite/tools/RelBuilderFactory.html" title="interface in org.apache.calcite.tools">RelBuilderFactory</a> relBuilderFactory)</code> </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <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="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>static boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#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/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> desc0, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel0, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> desc1, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel1, |
| <a href="../../../../org/apache/calcite/util/Litmus.html" title="interface in org.apache.calcite.util">Litmus</a> litmus)</code> |
| <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="../../../../org/apache/calcite/sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#getRollup-org.apache.calcite.sql.SqlAggFunction-">getRollup</a></span>(<a href="../../../../org/apache/calcite/sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a> aggregation)</code> </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#go-org.apache.calcite.rel.RelNode-">go</a></span>(<a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</code> |
| <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="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#go0-org.apache.calcite.rel.RelNode-">go0</a></span>(<a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</code> </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#isWeaker-org.apache.calcite.rel.mutable.MutableRel-org.apache.calcite.rel.mutable.MutableRel-">isWeaker</a></span>(<a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel0, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel)</code> |
| <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> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#mayBeSatisfiable-org.apache.calcite.rex.RexNode-">mayBeSatisfiable</a></span>(<a href="../../../../org/apache/calcite/rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> e)</code> |
| <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="../../../../org/apache/calcite/rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#permute-org.apache.calcite.rel.mutable.MutableAggregate-org.apache.calcite.rel.mutable.MutableRel-org.apache.calcite.util.mapping.Mapping-">permute</a></span>(<a href="../../../../org/apache/calcite/rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> aggregate, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> input, |
| <a href="../../../../org/apache/calcite/util/mapping/Mapping.html" title="interface in org.apache.calcite.util.mapping">Mapping</a> mapping)</code> </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>static org.apache.calcite.plan.SubstitutionVisitor.Replacement</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#replace-org.apache.calcite.rel.mutable.MutableRel-org.apache.calcite.rel.mutable.MutableRel-org.apache.calcite.rel.mutable.MutableRel-">replace</a></span>(<a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> query, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> find, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> replace)</code> |
| <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="../../../../org/apache/calcite/rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#splitFilter-org.apache.calcite.rex.RexSimplify-org.apache.calcite.rex.RexNode-org.apache.calcite.rex.RexNode-">splitFilter</a></span>(<a href="../../../../org/apache/calcite/rex/RexSimplify.html" title="class in org.apache.calcite.rex">RexSimplify</a> simplify, |
| <a href="../../../../org/apache/calcite/rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> condition, |
| <a href="../../../../org/apache/calcite/rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> target)</code> |
| <div class="block">Maps a condition onto a target.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>static <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.html#unifyAggregates-org.apache.calcite.rel.mutable.MutableAggregate-org.apache.calcite.rex.RexNode-org.apache.calcite.rel.mutable.MutableAggregate-">unifyAggregates</a></span>(<a href="../../../../org/apache/calcite/rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> query, |
| <a href="../../../../org/apache/calcite/rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> targetCond, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> target)</code> </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field.detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="DEFAULT_RULES"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>DEFAULT_RULES</h4> |
| <pre>protected static final com.google.common.collect.ImmutableList<<a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> DEFAULT_RULES</pre> |
| </li> |
| </ul> |
| <a name="relBuilder"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>relBuilder</h4> |
| <pre>protected final <a href="../../../../org/apache/calcite/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 name="slots"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>slots</h4> |
| <pre>protected final <a href="../../../../org/apache/calcite/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> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="SubstitutionVisitor-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="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../../../../org/apache/calcite/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 name="SubstitutionVisitor-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="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_, |
| com.google.common.collect.ImmutableList<<a href="../../../../org/apache/calcite/plan/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 name="SubstitutionVisitor-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="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> target_, |
| <a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> query_, |
| com.google.common.collect.ImmutableList<<a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.UnifyRule.html" title="class in org.apache.calcite.plan">SubstitutionVisitor.UnifyRule</a>> rules, |
| <a href="../../../../org/apache/calcite/tools/RelBuilderFactory.html" title="interface in org.apache.calcite.tools">RelBuilderFactory</a> relBuilderFactory)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="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>public static <a href="../../../../org/apache/calcite/rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> splitFilter(<a href="../../../../org/apache/calcite/rex/RexSimplify.html" title="class in org.apache.calcite.rex">RexSimplify</a> simplify, |
| <a href="../../../../org/apache/calcite/rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> condition, |
| <a href="../../../../org/apache/calcite/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 name="mayBeSatisfiable-org.apache.calcite.rex.RexNode-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>mayBeSatisfiable</h4> |
| <pre>public static boolean mayBeSatisfiable(<a href="../../../../org/apache/calcite/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 name="go0-org.apache.calcite.rel.RelNode-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>go0</h4> |
| <pre>public <a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> go0(<a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a> replacement_)</pre> |
| </li> |
| </ul> |
| <a name="go-org.apache.calcite.rel.RelNode-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>go</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../org/apache/calcite/rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>> go(<a href="../../../../org/apache/calcite/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 name="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>public static org.apache.calcite.plan.SubstitutionVisitor.Replacement replace(<a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> query, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> find, |
| <a href="../../../../org/apache/calcite/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 name="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>public static <a href="../../../../org/apache/calcite/rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> permute(<a href="../../../../org/apache/calcite/rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> aggregate, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> input, |
| <a href="../../../../org/apache/calcite/util/mapping/Mapping.html" title="interface in org.apache.calcite.util.mapping">Mapping</a> mapping)</pre> |
| </li> |
| </ul> |
| <a name="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>public static <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> unifyAggregates(<a href="../../../../org/apache/calcite/rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> query, |
| <a href="../../../../org/apache/calcite/rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a> targetCond, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableAggregate.html" title="class in org.apache.calcite.rel.mutable">MutableAggregate</a> target)</pre> |
| </li> |
| </ul> |
| <a name="getRollup-org.apache.calcite.sql.SqlAggFunction-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getRollup</h4> |
| <pre>public static <a href="../../../../org/apache/calcite/sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a> getRollup(<a href="../../../../org/apache/calcite/sql/SqlAggFunction.html" title="class in org.apache.calcite.sql">SqlAggFunction</a> aggregation)</pre> |
| </li> |
| </ul> |
| <a name="isWeaker-org.apache.calcite.rel.mutable.MutableRel-org.apache.calcite.rel.mutable.MutableRel-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isWeaker</h4> |
| <pre>protected boolean isWeaker(<a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel0, |
| <a href="../../../../org/apache/calcite/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 name="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>public static boolean equalType(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> desc0, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel0, |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> desc1, |
| <a href="../../../../org/apache/calcite/rel/mutable/MutableRel.html" title="class in org.apache.calcite.rel.mutable">MutableRel</a> rel1, |
| <a href="../../../../org/apache/calcite/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> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.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"> |
| <li><a href="../../../../org/apache/calcite/plan/Strong.Policy.html" title="enum in org.apache.calcite.plan"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/calcite/plan/SubstitutionVisitor.AbstractUnifyRule.html" title="class in org.apache.calcite.plan"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/calcite/plan/SubstitutionVisitor.html" target="_top">Frames</a></li> |
| <li><a href="SubstitutionVisitor.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.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> |
| </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 name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2012-2020 Apache Software Foundation. All Rights Reserved.</small></p> |
| </body> |
| </html> |