This is an automated email from the ASF dual-hosted git repository.

bridgetb pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/drill-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 1d07b75  add cross join example to doc
1d07b75 is described below

commit 1d07b75912615c7254003297bbfbd70fad7b5300
Author: Bridget Bevens <[email protected]>
AuthorDate: Mon Dec 3 17:01:45 2018 -0800

    add cross join example to doc
---
 docs/from-clause/index.html | 45 +++++++++++++++++++++++++++++++++++++++++----
 feed.xml                    |  4 ++--
 2 files changed, 43 insertions(+), 6 deletions(-)

diff --git a/docs/from-clause/index.html b/docs/from-clause/index.html
index 54377d0..07a2626 100644
--- a/docs/from-clause/index.html
+++ b/docs/from-clause/index.html
@@ -1409,8 +1409,10 @@ If the input row count for an aggregate function is 
larger than the value set fo
 <li>A join with the ON syntax retains both joining columns in its intermediate 
result set.<br></li>
 </ul>
 
-<h2 id="example">Example</h2>
-<div class="highlight"><pre><code class="language-text" data-lang="text">   0: 
jdbc:drill:zk=local&gt; SELECT tbl1.id, tbl1.type 
+<h2 id="examples">Examples</h2>
+
+<p>The following example joins two tables on the table id: </p>
+<div class="highlight"><pre><code class="language-text" data-lang="text">   
SELECT tbl1.id, tbl1.type 
    FROM dfs.`/Users/brumsby/drill/donuts.json` 
    AS tbl1
    JOIN
@@ -1421,9 +1423,44 @@ If the input row count for an aggregate function is 
larger than the value set fo
    |     id     |    type    |
    +------------+------------+
    | 0001       | donut      |
-   +------------+------------+
+   +------------+------------+  
+</code></pre></div>
+<p>In the following example, assume you have the following two tables that you 
want to join using a cross join:</p>
 
-   1 row selected (0.395 seconds)
+<p><strong>Note:</strong> These tables were created from the region.parquet 
and nation.parquet files from the sample-data folder included with the Drill 
installation.</p>
+<div class="highlight"><pre><code class="language-text" 
data-lang="text">SELECT * FROM tmp.`n_name`;
++----------+-----------------------+
+|  R_NAME  |       R_COMMENT    |
++----------+-----------------------+
+| AFRICA   | lar deposits. blithe  |
+| AMERICA  | hs use ironic, even   |
+| ASIA  | ges. thinly even pin  |
++----------+-----------------------+
+
+SELECT * FROM tmp.`n_key`;
++---------+--------------+
+| N_NAME  | N_NATIONKEY  |
++---------+--------------+
+| 0       | ALGERIA      |
+| 1       | ARGENTINA    |
+| 2       | BRAZIL       |
++---------+--------------+
+</code></pre></div>
+<p>Using CROSS JOIN to join the two tables produces the following results:</p>
+<div class="highlight"><pre><code class="language-text" 
data-lang="text">SELECT * FROM tmp.`n_key` CROSS JOIN tmp.`n_name`;
++---------+--------------+----------+----------------------------+
+| N_NAME  | N_NATIONKEY  |  R_NAME  |       R_COMMENT            |
++---------+--------------+----------+----------------------------+
+| 0       | ALGERIA      | AFRICA   | lar deposits. blithe       |
+| 0       | ALGERIA      | AMERICA  | hs use ironic, even        |
+| 0       | ALGERIA      | ASIA     | ges. thinly even pin       |
+| 1       | ARGENTINA    | AFRICA   | lar deposits. blithe       |
+| 1       | ARGENTINA    | AMERICA  | hs use ironic, even        |
+| 1       | ARGENTINA    | ASIA     | ges. thinly even pin       |
+| 2       | BRAZIL       | AFRICA   | lar deposits. blithe       |
+| 2       | BRAZIL       | AMERICA  | hs use ironic, even        |
+| 2       | BRAZIL       | ASIA     | ges. thinly even pin       |
++---------+--------------+----------+----------------------------+
 </code></pre></div>
     
       
diff --git a/feed.xml b/feed.xml
index b2d36ea..16d076a 100644
--- a/feed.xml
+++ b/feed.xml
@@ -6,8 +6,8 @@
 </description>
     <link>/</link>
     <atom:link href="/feed.xml" rel="self" type="application/rss+xml"/>
-    <pubDate>Mon, 03 Dec 2018 16:42:02 -0800</pubDate>
-    <lastBuildDate>Mon, 03 Dec 2018 16:42:02 -0800</lastBuildDate>
+    <pubDate>Mon, 03 Dec 2018 16:59:53 -0800</pubDate>
+    <lastBuildDate>Mon, 03 Dec 2018 16:59:53 -0800</lastBuildDate>
     <generator>Jekyll v2.5.2</generator>
     
       <item>

Reply via email to