Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jacques-n committed Aug 8, 2024
1 parent 621ead3 commit 4d93283
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 57 deletions.
13 changes: 7 additions & 6 deletions relations/logical_relations/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<span class=w> </span><span class=n>substrait.extensions.AdvancedExtension</span><span class=w> </span><span class=na>advanced_extension</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>10</span><span class=p>;</span>

<span class=p>}</span>
</code></pre></div> </div> </div> </div> <h2 id=join-operation>Join Operation<a class=headerlink href=#join-operation title="Permanent link">&para;</a></h2> <p>The join operation will combine two separate inputs into a single output, based on a join expression. A common subtype of joins is an equality join where the join expression is constrained to a list of equality (or equality + null equality) conditions between the two inputs of the join.</p> <table> <thead> <tr> <th>Signature</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Inputs</td> <td>2</td> </tr> <tr> <td>Outputs</td> <td>1</td> </tr> <tr> <td>Property Maintenance</td> <td>Distribution is maintained. Orderedness is empty post operation. Physical relations may provide better property maintenance.</td> </tr> <tr> <td>Direct Output Order</td> <td>The emit order of the left input followed by the emit order of the right input.</td> </tr> </tbody> </table> <h3 id=join-properties>Join Properties<a class=headerlink href=#join-properties title="Permanent link">&para;</a></h3> <table> <thead> <tr> <th>Property</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Left Input</td> <td>A relational input.</td> <td>Required</td> </tr> <tr> <td>Right Input</td> <td>A relational input.</td> <td>Required</td> </tr> <tr> <td>Join Expression</td> <td>A boolean condition that describes whether each record from the left set &ldquo;match&rdquo; the record from the right set. Field references correspond to the direct output order of the data.</td> <td>Required. Can be the literal True.</td> </tr> <tr> <td>Post-Join Filter</td> <td>A boolean condition to be applied to each result record after the inputs have been joined, yielding only the records that satisfied the condition.</td> <td>Optional</td> </tr> <tr> <td>Join Type</td> <td>One of the join types defined below.</td> <td>Required</td> </tr> </tbody> </table> <h3 id=join-types>Join Types<a class=headerlink href=#join-types title="Permanent link">&para;</a></h3> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Inner</td> <td>Return records from the left side only if they match the right side. Return records from the right side only when they match the left side. For each cross input match, return a record including the data from both sides. Non-matching records are ignored.</td> </tr> <tr> <td>Outer</td> <td>Return all records from both the left and right inputs. For each cross input match, return a record including the data from both sides. For any remaining non-match records, return the record from the corresponding input along with nulls for the opposite input.</td> </tr> <tr> <td>Left</td> <td>Return all records from the left input. For each cross input match, return a record including the data from both sides. For any remaining non-matching records from the left input, return the left record along with nulls for the right input.</td> </tr> <tr> <td>Right</td> <td>Return all records from the right input. For each cross input match, return a record including the data from both sides. For any remaining non-matching records from the right input, return the right record along with nulls for the left input.</td> </tr> <tr> <td>Semi</td> <td>Returns records from the left input. These are returned only if the records have a join partner on the right side.</td> </tr> <tr> <td>Anti</td> <td>Return records from the left input. These are returned only if the records do not have a join partner on the right side.</td> </tr> <tr> <td>Single</td> <td>Returns one join partner per entry on the left input. If more than one join partner exists, there are two valid semantics. 1) Only the first match is returned. 2) The system throws an error. If there is no match between the left and right inputs, NULL is returned.</td> </tr> </tbody> </table> <div class="tabbed-set tabbed-alternate" data-tabs=6:1><input checked=checked id=__tabbed_6_1 name=__tabbed_6 type=radio><div class=tabbed-labels><label for=__tabbed_6_1>JoinRel Message</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=kd>message</span><span class=w> </span><span class=nc>JoinRel</span><span class=w> </span><span class=p>{</span>
</code></pre></div> </div> </div> </div> <h2 id=join-operation>Join Operation<a class=headerlink href=#join-operation title="Permanent link">&para;</a></h2> <p>The join operation will combine two separate inputs into a single output, based on a join expression. A common subtype of joins is an equality join where the join expression is constrained to a list of equality (or equality + null equality) conditions between the two inputs of the join.</p> <table> <thead> <tr> <th>Signature</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Inputs</td> <td>2</td> </tr> <tr> <td>Outputs</td> <td>1</td> </tr> <tr> <td>Property Maintenance</td> <td>Distribution is maintained. Orderedness is empty post operation. Physical relations may provide better property maintenance.</td> </tr> <tr> <td>Direct Output Order</td> <td>The emit order of the left input followed by the emit order of the right input.</td> </tr> </tbody> </table> <h3 id=join-properties>Join Properties<a class=headerlink href=#join-properties title="Permanent link">&para;</a></h3> <table> <thead> <tr> <th>Property</th> <th>Description</th> <th>Required</th> </tr> </thead> <tbody> <tr> <td>Left Input</td> <td>A relational input.</td> <td>Required</td> </tr> <tr> <td>Right Input</td> <td>A relational input.</td> <td>Required</td> </tr> <tr> <td>Join Expression</td> <td>A boolean condition that describes whether each record from the left set &ldquo;match&rdquo; the record from the right set. Field references correspond to the direct output order of the data.</td> <td>Required. Can be the literal True.</td> </tr> <tr> <td>Post-Join Filter</td> <td>A boolean condition to be applied to each result record after the inputs have been joined, yielding only the records that satisfied the condition.</td> <td>Optional</td> </tr> <tr> <td>Join Type</td> <td>One of the join types defined below.</td> <td>Required</td> </tr> </tbody> </table> <h3 id=join-types>Join Types<a class=headerlink href=#join-types title="Permanent link">&para;</a></h3> <table> <thead> <tr> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Inner</td> <td>Return records from the left side only if they match the right side. Return records from the right side only when they match the left side. For each cross input match, return a record including the data from both sides. Non-matching records are ignored.</td> </tr> <tr> <td>Outer</td> <td>Return all records from both the left and right inputs. For each cross input match, return a record including the data from both sides. For any remaining non-match records, return the record from the corresponding input along with nulls for the opposite input.</td> </tr> <tr> <td>Left</td> <td>Return all records from the left input. For each cross input match, return a record including the data from both sides. For any remaining non-matching records from the left input, return the left record along with nulls for the right input.</td> </tr> <tr> <td>Right</td> <td>Return all records from the right input. For each cross input match, return a record including the data from both sides. For any remaining non-matching records from the right input, return the right record along with nulls for the left input.</td> </tr> <tr> <td>Left Semi</td> <td>Returns records from the left input. These are returned only if the records have a join partner on the right side.</td> </tr> <tr> <td>Right Semi</td> <td>Returns records from the right input. These are returned only if the records have a join partner on the left side.</td> </tr> <tr> <td>Left Anti</td> <td>Return records from the left input. These are returned only if the records do not have a join partner on the right side.</td> </tr> <tr> <td>Right Anti</td> <td>Return records from the right input. These are returned only if the records do not have a join partner on the left side.</td> </tr> <tr> <td>Left Single</td> <td>Return all records from the left input with no join expansion. If at least one record from the right input matches the left, return one arbitrary matching record from the right input. For any left records without matching right records, return the left record along with nulls for the right input. Similar to a left outer join but only returns one right match at most. Useful for nested sub-queries where we need exactly one record in output (or throw exception). See Section 3.2 of <a href=https://15721.courses.cs.cmu.edu/spring2018/papers/16-optimizer2/hyperjoins-btw2017.pdf>https://15721.courses.cs.cmu.edu/spring2018/papers/16-optimizer2/hyperjoins-btw2017.pdf</a> for more information.</td> </tr> <tr> <td>Right Single</td> <td>Same as left single except that the right and left inputs are switched.</td> </tr> </tbody> </table> <div class="tabbed-set tabbed-alternate" data-tabs=6:1><input checked=checked id=__tabbed_6_1 name=__tabbed_6 type=radio><div class=tabbed-labels><label for=__tabbed_6_1>JoinRel Message</label></div> <div class=tabbed-content> <div class=tabbed-block> <div class=highlight><pre><span></span><code><span class=kd>message</span><span class=w> </span><span class=nc>JoinRel</span><span class=w> </span><span class=p>{</span>
<span class=w> </span><span class=n>RelCommon</span><span class=w> </span><span class=na>common</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>1</span><span class=p>;</span>
<span class=w> </span><span class=n>Rel</span><span class=w> </span><span class=na>left</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>2</span><span class=p>;</span>
<span class=w> </span><span class=n>Rel</span><span class=w> </span><span class=na>right</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>3</span><span class=p>;</span>
Expand All @@ -131,11 +131,12 @@
<span class=w> </span><span class=na>JOIN_TYPE_OUTER</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>2</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_LEFT</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>3</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_RIGHT</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>4</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_SEMI</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>5</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_ANTI</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>6</span><span class=p>;</span>
<span class=w> </span><span class=c1>// This join is useful for nested sub-queries where we need exactly one record in output (or throw exception)</span>
<span class=w> </span><span class=c1>// See Section 3.2 of https://15721.courses.cs.cmu.edu/spring2018/papers/16-optimizer2/hyperjoins-btw2017.pdf</span>
<span class=w> </span><span class=na>JOIN_TYPE_SINGLE</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>7</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_LEFT_SEMI</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>5</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_LEFT_ANTI</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>6</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_LEFT_SINGLE</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>7</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_RIGHT_SEMI</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>8</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_RIGHT_ANTI</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>9</span><span class=p>;</span>
<span class=w> </span><span class=na>JOIN_TYPE_RIGHT_SINGLE</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>10</span><span class=p>;</span>
<span class=w> </span><span class=p>}</span>

<span class=w> </span><span class=n>substrait.extensions.AdvancedExtension</span><span class=w> </span><span class=na>advanced_extension</span><span class=w> </span><span class=o>=</span><span class=w> </span><span class=mi>10</span><span class=p>;</span>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 4d93283

Please sign in to comment.