You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by br...@apache.org on 2018/12/04 00:40:08 UTC

[drill] branch gh-pages updated: update docs cross join support

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

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


The following commit(s) were added to refs/heads/gh-pages by this push:
     new 270cadc  update docs cross join support
270cadc is described below

commit 270cadcd7e8c4ddb8590f2cc609dc1f4e03c058f
Author: Bridget Bevens <bb...@maprtech.com>
AuthorDate: Mon Dec 3 16:39:03 2018 -0800

    update docs cross join support
---
 _docs/sql-reference/sql-commands/079-select.md     |  6 +++---
 .../sql-reference/sql-commands/081-from-clause.md  | 23 ++++++++++++++++++++--
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/_docs/sql-reference/sql-commands/079-select.md b/_docs/sql-reference/sql-commands/079-select.md
index 96a0087..19c17d1 100644
--- a/_docs/sql-reference/sql-commands/079-select.md
+++ b/_docs/sql-reference/sql-commands/079-select.md
@@ -1,6 +1,6 @@
 ---
 title: "SELECT"
-date: 2017-03-14 22:11:02 UTC
+date: 2018-12-04
 parent: "SQL Commands"
 ---
 Drill supports the following ANSI standard clauses in the SELECT statement:
@@ -46,6 +46,7 @@ Drill supports ANSI standard joins in the FROM and WHERE clauses:
 
   * Inner joins
   * Left, full, and right outer joins
+  * Cross joins (as of Drill 1.15)
 
 The following types of join syntax are supported:
 
@@ -55,8 +56,7 @@ The following types of join syntax are supported:
 | ON join in FROM clause         | FROM table1 JOIN table2 ON table1.col1=table2.col1 |
 
 
-Cross-joins are not yet supported. You must specify a join condition when more
-than one table is listed in the FROM clause.
+You must specify a join condition when more than one table is listed in the FROM clause.
 
 Non-equijoins are supported if the join also contains an equality condition on
 the same two tables as part of a conjunction:
diff --git a/_docs/sql-reference/sql-commands/081-from-clause.md b/_docs/sql-reference/sql-commands/081-from-clause.md
index 4930627..3d50b5e 100644
--- a/_docs/sql-reference/sql-commands/081-from-clause.md
+++ b/_docs/sql-reference/sql-commands/081-from-clause.md
@@ -1,6 +1,6 @@
 ---
 title: "FROM Clause"
-date: 2018-08-03 02:07:16 UTC
+date: 2018-12-04
 parent: "SQL Commands"
 ---
 The FROM clause lists the references (tables, views, and subqueries) that data is selected from. Drill expands the traditional concept of a “table reference” in a standard SQL FROM clause to refer to files and directories in a local or distributed file system.
@@ -113,7 +113,26 @@ OUTER JOIN
 Return all of the rows that the equivalent inner join would return plus non-matching rows from the "left" table, "right" table, or both tables. The left table is the first-listed table, and the right table is the second-listed table. The non-matching rows contain NULL values to fill the gaps in the output columns.  
 
 LATERAL  
-A lateral join is essentially a foreach loop in SQL. A lateral join is represented by the keyword LATERAL with an inner subquery in the FROM clause. See [Lateral Join]({{site.baseurl}}/docs/lateral-join/).
+A lateral join is essentially a foreach loop in SQL. A lateral join is represented by the keyword LATERAL with an inner subquery in the FROM clause. See [Lateral Join]({{site.baseurl}}/docs/lateral-join/).  
+
+CROSS JOIN  
+Starting in Drill 1.15, Drill supports cross joins. A cross join returns the cartesian product of two tables. Cross joins are disabled by default because they can produce extremely large result sets that cause out of memory errors. 
+
+To enable cross joins, disable the `planner.enable_nljoin_for_scalar_only` option, as shown:  
+
+	set `planner.enable_nljoin_for_scalar_only` = false;  
+	+-------+-------------------------------------------------+
+	|  ok   |                 	summary                 	  | 
+	+-------+-------------------------------------------------+
+	| true  | planner.enable_nljoin_for_scalar_only updated.  |
+	+-------+-------------------------------------------------+  
+
+Before you enable the cross join functionality, verify that Drill has enough memory to process the query. Also note the following limitation related to the use of aggregate functions with cross joins.
+
+**Limitation**  
+If the input row count for an aggregate function is larger than the value set for the `planner.slice_target` option, Drill cannot plan the query. As a workaround, set the `planner.enable_multiphase_agg` option to false. This limitation will be resolved with [DRILL-6839](https://issues.apache.org/jira/browse/DRILL-6839).
+
+
 
 ## Usage Notes  
    * Joined columns must have comparable data types.