drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tshi...@apache.org
Subject [3/3] drill git commit: Bridget's SQL command updates
Date Tue, 02 Jun 2015 04:55:35 GMT
Bridget's SQL command updates


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/1e05eb3e
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/1e05eb3e
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/1e05eb3e

Branch: refs/heads/gh-pages
Commit: 1e05eb3e28bd2b37cdbcd1b1bb0d3dc28ccc8fae
Parents: a03aa49
Author: Kristine Hahn <khahn@maprtech.com>
Authored: Mon Jun 1 18:27:42 2015 -0700
Committer: Kristine Hahn <khahn@maprtech.com>
Committed: Mon Jun 1 18:27:42 2015 -0700

----------------------------------------------------------------------
 _data/docs.json                                 | 124 ++++++++++++++++---
 _docs/sql-reference/sql-commands/079-select.md  |  79 ++++++++++++
 .../sql-commands/080-select-list.md             |  71 +++++++++++
 _docs/sql-reference/sql-commands/080-select.md  |  79 ------------
 .../sql-commands/081-from-clause.md             |  49 +++-----
 .../sql-commands/083-having-clause.md           |   2 +-
 .../sql-commands/084-limit-clause.md            |   8 +-
 .../sql-commands/085-offset-clause.md           |   5 +-
 .../sql-commands/087-union-set-operator.md      |   7 +-
 .../sql-commands/088-where-clause.md            |  10 +-
 .../sql-commands/089-with-clause.md             |  18 +--
 11 files changed, 295 insertions(+), 157 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_data/docs.json
----------------------------------------------------------------------
diff --git a/_data/docs.json b/_data/docs.json
index f0a8fb6..5df345e 100644
--- a/_data/docs.json
+++ b/_data/docs.json
@@ -2968,8 +2968,8 @@
             "next_title": "GROUP BY Clause", 
             "next_url": "/docs/group-by-clause/", 
             "parent": "SQL Commands", 
-            "previous_title": "SELECT", 
-            "previous_url": "/docs/select/", 
+            "previous_title": "SELECT List", 
+            "previous_url": "/docs/select-list/", 
             "relative_path": "_docs/sql-reference/sql-commands/081-from-clause.md", 
             "title": "FROM Clause", 
             "url": "/docs/from-clause/"
@@ -7210,15 +7210,36 @@
                 }
             ], 
             "children": [], 
-            "next_title": "FROM Clause", 
-            "next_url": "/docs/from-clause/", 
+            "next_title": "SELECT List", 
+            "next_url": "/docs/select-list/", 
             "parent": "SQL Commands", 
             "previous_title": "EXPLAIN", 
             "previous_url": "/docs/explain/", 
-            "relative_path": "_docs/sql-reference/sql-commands/080-select.md", 
+            "relative_path": "_docs/sql-reference/sql-commands/079-select.md", 
             "title": "SELECT", 
             "url": "/docs/select/"
         }, 
+        "SELECT List": {
+            "breadcrumbs": [
+                {
+                    "title": "SQL Commands", 
+                    "url": "/docs/sql-commands/"
+                }, 
+                {
+                    "title": "SQL Reference", 
+                    "url": "/docs/sql-reference/"
+                }
+            ], 
+            "children": [], 
+            "next_title": "FROM Clause", 
+            "next_url": "/docs/from-clause/", 
+            "parent": "SQL Commands", 
+            "previous_title": "SELECT", 
+            "previous_url": "/docs/select/", 
+            "relative_path": "_docs/sql-reference/sql-commands/080-select-list.md", 
+            "title": "SELECT List", 
+            "url": "/docs/select-list/"
+        }, 
         "SHOW DATABASES and SHOW SCHEMAS": {
             "breadcrumbs": [
                 {
@@ -7470,12 +7491,12 @@
                         }
                     ], 
                     "children": [], 
-                    "next_title": "FROM Clause", 
-                    "next_url": "/docs/from-clause/", 
+                    "next_title": "SELECT List", 
+                    "next_url": "/docs/select-list/", 
                     "parent": "SQL Commands", 
                     "previous_title": "EXPLAIN", 
                     "previous_url": "/docs/explain/", 
-                    "relative_path": "_docs/sql-reference/sql-commands/080-select.md", 
+                    "relative_path": "_docs/sql-reference/sql-commands/079-select.md", 
                     "title": "SELECT", 
                     "url": "/docs/select/"
                 }, 
@@ -7491,11 +7512,32 @@
                         }
                     ], 
                     "children": [], 
-                    "next_title": "GROUP BY Clause", 
-                    "next_url": "/docs/group-by-clause/", 
+                    "next_title": "FROM Clause", 
+                    "next_url": "/docs/from-clause/", 
                     "parent": "SQL Commands", 
                     "previous_title": "SELECT", 
                     "previous_url": "/docs/select/", 
+                    "relative_path": "_docs/sql-reference/sql-commands/080-select-list.md",

+                    "title": "SELECT List", 
+                    "url": "/docs/select-list/"
+                }, 
+                {
+                    "breadcrumbs": [
+                        {
+                            "title": "SQL Commands", 
+                            "url": "/docs/sql-commands/"
+                        }, 
+                        {
+                            "title": "SQL Reference", 
+                            "url": "/docs/sql-reference/"
+                        }
+                    ], 
+                    "children": [], 
+                    "next_title": "GROUP BY Clause", 
+                    "next_url": "/docs/group-by-clause/", 
+                    "parent": "SQL Commands", 
+                    "previous_title": "SELECT List", 
+                    "previous_url": "/docs/select-list/", 
                     "relative_path": "_docs/sql-reference/sql-commands/081-from-clause.md",

                     "title": "FROM Clause", 
                     "url": "/docs/from-clause/"
@@ -8611,12 +8653,12 @@
                                 }
                             ], 
                             "children": [], 
-                            "next_title": "FROM Clause", 
-                            "next_url": "/docs/from-clause/", 
+                            "next_title": "SELECT List", 
+                            "next_url": "/docs/select-list/", 
                             "parent": "SQL Commands", 
                             "previous_title": "EXPLAIN", 
                             "previous_url": "/docs/explain/", 
-                            "relative_path": "_docs/sql-reference/sql-commands/080-select.md",

+                            "relative_path": "_docs/sql-reference/sql-commands/079-select.md",

                             "title": "SELECT", 
                             "url": "/docs/select/"
                         }, 
@@ -8632,11 +8674,32 @@
                                 }
                             ], 
                             "children": [], 
-                            "next_title": "GROUP BY Clause", 
-                            "next_url": "/docs/group-by-clause/", 
+                            "next_title": "FROM Clause", 
+                            "next_url": "/docs/from-clause/", 
                             "parent": "SQL Commands", 
                             "previous_title": "SELECT", 
                             "previous_url": "/docs/select/", 
+                            "relative_path": "_docs/sql-reference/sql-commands/080-select-list.md",

+                            "title": "SELECT List", 
+                            "url": "/docs/select-list/"
+                        }, 
+                        {
+                            "breadcrumbs": [
+                                {
+                                    "title": "SQL Commands", 
+                                    "url": "/docs/sql-commands/"
+                                }, 
+                                {
+                                    "title": "SQL Reference", 
+                                    "url": "/docs/sql-reference/"
+                                }
+                            ], 
+                            "children": [], 
+                            "next_title": "GROUP BY Clause", 
+                            "next_url": "/docs/group-by-clause/", 
+                            "parent": "SQL Commands", 
+                            "previous_title": "SELECT List", 
+                            "previous_url": "/docs/select-list/", 
                             "relative_path": "_docs/sql-reference/sql-commands/081-from-clause.md",

                             "title": "FROM Clause", 
                             "url": "/docs/from-clause/"
@@ -13568,12 +13631,12 @@
                                 }
                             ], 
                             "children": [], 
-                            "next_title": "FROM Clause", 
-                            "next_url": "/docs/from-clause/", 
+                            "next_title": "SELECT List", 
+                            "next_url": "/docs/select-list/", 
                             "parent": "SQL Commands", 
                             "previous_title": "EXPLAIN", 
                             "previous_url": "/docs/explain/", 
-                            "relative_path": "_docs/sql-reference/sql-commands/080-select.md",

+                            "relative_path": "_docs/sql-reference/sql-commands/079-select.md",

                             "title": "SELECT", 
                             "url": "/docs/select/"
                         }, 
@@ -13589,11 +13652,32 @@
                                 }
                             ], 
                             "children": [], 
-                            "next_title": "GROUP BY Clause", 
-                            "next_url": "/docs/group-by-clause/", 
+                            "next_title": "FROM Clause", 
+                            "next_url": "/docs/from-clause/", 
                             "parent": "SQL Commands", 
                             "previous_title": "SELECT", 
                             "previous_url": "/docs/select/", 
+                            "relative_path": "_docs/sql-reference/sql-commands/080-select-list.md",

+                            "title": "SELECT List", 
+                            "url": "/docs/select-list/"
+                        }, 
+                        {
+                            "breadcrumbs": [
+                                {
+                                    "title": "SQL Commands", 
+                                    "url": "/docs/sql-commands/"
+                                }, 
+                                {
+                                    "title": "SQL Reference", 
+                                    "url": "/docs/sql-reference/"
+                                }
+                            ], 
+                            "children": [], 
+                            "next_title": "GROUP BY Clause", 
+                            "next_url": "/docs/group-by-clause/", 
+                            "parent": "SQL Commands", 
+                            "previous_title": "SELECT List", 
+                            "previous_url": "/docs/select-list/", 
                             "relative_path": "_docs/sql-reference/sql-commands/081-from-clause.md",

                             "title": "FROM Clause", 
                             "url": "/docs/from-clause/"

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/079-select.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/079-select.md b/_docs/sql-reference/sql-commands/079-select.md
new file mode 100755
index 0000000..3e20134
--- /dev/null
+++ b/_docs/sql-reference/sql-commands/079-select.md
@@ -0,0 +1,79 @@
+---
+title: "SELECT"
+parent: "SQL Commands"
+---
+Drill supports the following ANSI standard clauses in the SELECT statement:
+
+  * WITH clause
+  * SELECT list
+  * FROM clause
+  * WHERE clause
+  * GROUP BY clause
+  * HAVING clause
+  * UNION ALL set operator
+  * ORDER BY clause (with an optional LIMIT clause)
+  * Limit clause
+  * Offset clause
+
+You can use the same SELECT syntax in the following commands:
+
+  * CREATE TABLE AS (CTAS)
+  * CREATE VIEW
+
+INSERT INTO SELECT is not yet supported.
+
+## Column Aliases
+
+You can use named column aliases in the SELECT list to provide meaningful
+names for regular columns and computed columns, such as the results of
+aggregate functions. See the section on running queries for examples.
+
+You cannot reference column aliases in the following clauses:
+
+  * WHERE
+  * GROUP BY
+  * HAVING
+
+Because Drill works with schema-less data sources, you cannot use positional
+aliases (1, 2, etc.) to refer to SELECT list columns, except in the ORDER BY
+clause.
+
+## Joins
+
+Drill supports ANSI standard joins in the FROM and WHERE clauses:
+
+  * Inner joins
+  * Left, full, and right outer joins
+
+The following types of join syntax are supported:
+
+| Join type                      | Syntax                                             |
+|--------------------------------|----------------------------------------------------|
+| Join condition in WHERE clause | FROM table1, table 2 WHERE table1.col1=table2.col1 |
+| 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.
+
+Non-equijoins are supported if the join also contains an equality condition on
+the same two tables as part of a conjunction:
+
+    table1.col1 = table2.col1 AND table1.c2 < table2.c2
+
+This restriction applies to both inner and outer joins.
+
+## Subqueries
+
+You can use the following subquery operators in Drill queries. These operators
+all return Boolean results.
+
+  * ALL
+  * ANY
+  * EXISTS
+  * IN
+  * SOME
+
+In general, correlated subqueries are supported. EXISTS and NOT EXISTS
+subqueries that do not contain a correlation join are not yet supported.
+

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/080-select-list.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/080-select-list.md b/_docs/sql-reference/sql-commands/080-select-list.md
new file mode 100755
index 0000000..e5d0cac
--- /dev/null
+++ b/_docs/sql-reference/sql-commands/080-select-list.md
@@ -0,0 +1,71 @@
+---
+title: "SELECT List"
+parent: "SQL Commands"
+---
+
+The SELECT list names the columns, functions, and expressions that you want the query to
return. The list represents the output of the query.
+
+## Syntax  
+
+The SELECT list supports the following syntax:  
+
+       SELECT  [ DISTINCT ] columns[n] | * | expression [ AS column_alias ] [, ...]  
+
+## Parameters
+COLUMNS[*n*]  
+Array columns are used for reading data from text files. Use the columns[*n*] syntax in the
SELECT list to return rows from text files in a columnar format. This syntax uses a zero-based
index, so the first column is column 0.  
+
+DISTINCT  
+An option that eliminates duplicate rows from the result set, based on matching values in
one or more columns.
+* (asterisk)
+Returns the entire contents of the table or file.
+
+*expression*  
+An expression formed from one or more columns that exist in the tables, files, or directories
referenced by the query. An expression can contain functions and aliases that define select
list entries. You can also use a scalar aggregate subquery as the expression in the SELECT
list. 
+
+*scalar aggregate subquery*  
+A scalar aggregate subquery is a regular SELECT query in parentheses that returns exactly
one column value from one row. The returned value is used in the outer query. The scalar aggregate
subquery must include an aggregate function, such as MAX(), AVG(), or COUNT(). If the subquery
returns zero rows, the value of the subquery expression is null. If it returns more than one
row, Drill returns an error.  Scalar subqueries are not valid expressions in the following
cases:  
+
+* As default values for expressions
+* In GROUP BY and HAVING clauses  
+
+AS *column_alias*  
+A temporary name for a column in the final result set. The AS keyword is optional.  
+
+## Examples
+The following example shows a query with a scalar subquery expression:  
+
+       SELECT a1, (SELECT MAX(a2) FROM t2) AS max_a2 FROM t1;       
+       +-----+-------+
+       | a1   | max_a2 |
+       +-----+-------+
+       | 1    | 9 |
+       | 2    | 9 |
+       | 3    | 9 |
+       | 4    | 9 |
+       | 5    | 9 |
+       | 6    | 9 |
+       | 7    | 9 |
+       | null | 9 |
+       | 9    | 9 |
+       | 10   | 9 |
+       +-----+-------+
+       10 rows selected (0.244 seconds)
+
+The following example shows a query with array columns that return rows in column format
for easier readability:  
+
+       SELECT COLUMNS[0], COLUMNS[1] FROM dfs.`/Users/brumsby/drill/plays.csv`;       
+       +------------+------------------------+
+       |   EXPR$0   |         EXPR$1         |
+       +------------+------------------------+
+       | 1599       | As You Like It         |
+       | 1601       | Twelfth Night          |
+       | 1594       | Comedy of Errors       |
+       | 1595       | Romeo and Juliet       |
+       | 1596       | The Merchant of Venice |
+       | 1610       | The Tempest            |
+       | 1599       | Hamlet                 |
+       +------------+------------------------+
+       7 rows selected (0.137 seconds)
+       
+

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/080-select.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/080-select.md b/_docs/sql-reference/sql-commands/080-select.md
deleted file mode 100755
index 3e20134..0000000
--- a/_docs/sql-reference/sql-commands/080-select.md
+++ /dev/null
@@ -1,79 +0,0 @@
----
-title: "SELECT"
-parent: "SQL Commands"
----
-Drill supports the following ANSI standard clauses in the SELECT statement:
-
-  * WITH clause
-  * SELECT list
-  * FROM clause
-  * WHERE clause
-  * GROUP BY clause
-  * HAVING clause
-  * UNION ALL set operator
-  * ORDER BY clause (with an optional LIMIT clause)
-  * Limit clause
-  * Offset clause
-
-You can use the same SELECT syntax in the following commands:
-
-  * CREATE TABLE AS (CTAS)
-  * CREATE VIEW
-
-INSERT INTO SELECT is not yet supported.
-
-## Column Aliases
-
-You can use named column aliases in the SELECT list to provide meaningful
-names for regular columns and computed columns, such as the results of
-aggregate functions. See the section on running queries for examples.
-
-You cannot reference column aliases in the following clauses:
-
-  * WHERE
-  * GROUP BY
-  * HAVING
-
-Because Drill works with schema-less data sources, you cannot use positional
-aliases (1, 2, etc.) to refer to SELECT list columns, except in the ORDER BY
-clause.
-
-## Joins
-
-Drill supports ANSI standard joins in the FROM and WHERE clauses:
-
-  * Inner joins
-  * Left, full, and right outer joins
-
-The following types of join syntax are supported:
-
-| Join type                      | Syntax                                             |
-|--------------------------------|----------------------------------------------------|
-| Join condition in WHERE clause | FROM table1, table 2 WHERE table1.col1=table2.col1 |
-| 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.
-
-Non-equijoins are supported if the join also contains an equality condition on
-the same two tables as part of a conjunction:
-
-    table1.col1 = table2.col1 AND table1.c2 < table2.c2
-
-This restriction applies to both inner and outer joins.
-
-## Subqueries
-
-You can use the following subquery operators in Drill queries. These operators
-all return Boolean results.
-
-  * ALL
-  * ANY
-  * EXISTS
-  * IN
-  * SOME
-
-In general, correlated subqueries are supported. EXISTS and NOT EXISTS
-subqueries that do not contain a correlation join are not yet supported.
-

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/081-from-clause.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/081-from-clause.md b/_docs/sql-reference/sql-commands/081-from-clause.md
index 8f5ab37..d38cccd 100755
--- a/_docs/sql-reference/sql-commands/081-from-clause.md
+++ b/_docs/sql-reference/sql-commands/081-from-clause.md
@@ -21,49 +21,42 @@ Includes one or more *table_references* and is typically followed by the
WHERE,
        ( subquery ) [ AS ] alias [ ( column_alias [, ...] ) ]
        table_reference [ ON join_condition ]
 
-   * *with\_subquery\_table_name*
+   * *with\_subquery\_table_name*  
+   A table defined by a subquery in the WITH clause.
 
-       A table defined by a subquery in the WITH clause.
+  * *table_name*  
+  Name of a table or view. In Drill, you can also refer to a file system directory or a specific
file.
 
+   * *alias*  
+   A temporary alternative name for a table or view that provides a convenient shortcut for
identifying tables in other parts of a query, such as the WHERE clause. You must supply an
alias for a table derived from a subquery. In other table references, aliases are optional.
The AS keyword is always optional. Drill does not support the GROUP BY alias.
 
-  * *table_name* 
-  
-    Name of a table or view. In Drill, you can also refer to a file system directory or a
specific file.
+   * *column_alias*  
+   A temporary alternative name for a column in a table or view. You can use named column
aliases in the SELECT list to provide meaningful names for regular columns and computed columns,
such as the results of aggregate functions. You cannot reference column aliases in the following
clauses:  
+       WHERE  
+       GROUP BY  
+       HAVING  
 
-   * *alias* 
+       Because Drill works with schema-less data sources, you cannot use positional aliases
(1, 2, etc.) to refer to SELECT list columns, except in the ORDER BY clause.
 
-    A temporary alternative name for a table or view that provides a convenient shortcut
for identifying tables in other parts of a query, such as the WHERE clause. You must supply
an alias for a table derived from a subquery. In other table references, aliases are optional.
The AS keyword is always optional. Drill does not support the GROUP BY alias.
-
-   * *column_alias*  
-     
-    A temporary alternative name for a column in a table or view.
-
-   * *subquery*  
-  
-     A query expression that evaluates to a table. The table exists only for the duration
of the query and is typically given a name or alias, though an alias is not required. You
can also define column names for tables that derive from subqueries. Naming column aliases
is important when you want to join the results of subqueries to other tables and when you
want to select or constrain those columns elsewhere in the query. A subquery may contain an
ORDER BY clause, but this clause may have no effect if a LIMIT or OFFSET clause is not also
specified.
-
-   * *join_type*  
- 
-    Specifies one of the following join types: 
+   * *subquery*  
+   A query expression that evaluates to a table. The table exists only for the duration of
the query and is typically given a name or alias, though an alias is not required. You can
also define column names for tables that derive from subqueries. Naming column aliases is
important when you want to join the results of subqueries to other tables and when you want
to select or constrain those columns elsewhere in the query. A subquery may contain an ORDER
BY clause, but this clause may have no effect if a LIMIT or OFFSET clause is not also specified.
 
+   * *join_type*  
+   Specifies one of the following join types:  
        [INNER] JOIN  
        LEFT [OUTER] JOIN  
        RIGHT [OUTER] JOIN  
        FULL [OUTER] JOIN
 
-   * *ON join_condition*  
-
-       A type of join specification where the joining columns are stated as a condition that
follows the ON keyword.  
-       Example:  
-      ` homes join listing on homes.listid=listing.listid and homes.homeid=listing.homeid`
+   * *ON join_condition*  
+   A type of join specification where the joining columns are stated as a condition that
follows the ON keyword.  
+       Example:  ` homes join listing on homes.listid=listing.listid and homes.homeid=listing.homeid`
 
 ## Join Types
 INNER JOIN  
-
 Return matching rows only, based on the join condition or list of joining columns.  
 
-OUTER JOIN 
-
+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.
 
 ## Usage Notes  
@@ -71,5 +64,3 @@ Return all of the rows that the equivalent inner join would return plus
non-matc
    * A join with the ON syntax retains both joining columns in its intermediate result set.
 
 
-## Examples
-

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/083-having-clause.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/083-having-clause.md b/_docs/sql-reference/sql-commands/083-having-clause.md
index 1a079b0..be64be4 100755
--- a/_docs/sql-reference/sql-commands/083-having-clause.md
+++ b/_docs/sql-reference/sql-commands/083-having-clause.md
@@ -7,7 +7,7 @@ The HAVING clause filters group rows created by the GROUP BY clause. The HAVING
 ## Syntax
 The HAVING clause supports the following syntax:  
 
-`[ HAVING  boolean_expression ]`  
+       HAVING  boolean_expression 
 
 ## Expression  
 A *boolean expression* can include one or more of the following operators:  

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/084-limit-clause.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/084-limit-clause.md b/_docs/sql-reference/sql-commands/084-limit-clause.md
index 459c0c0..d691119 100755
--- a/_docs/sql-reference/sql-commands/084-limit-clause.md
+++ b/_docs/sql-reference/sql-commands/084-limit-clause.md
@@ -8,21 +8,21 @@ The LIMIT clause limits the result set to the specified number of rows.
You can
 ## Syntax
 The LIMIT clause supports the following syntax:  
 
-       [ LIMIT { count | ALL } ]
+       LIMIT { count | ALL }
 
 Specifying ALL returns all records, which is equivalent to omitting the LIMIT clause from
the SELECT statement.
 
 ## Parameters
 *count*  
-
 Specifies the maximum number of rows to return.
 If the count expression evaluates to NULL, Drill treats it as LIMIT ALL. 
 
 ## Examples
 The following example query includes the ORDER BY and LIMIT clauses and returns the top 20
sales totals by month and state:  
 
-       0: jdbc:drill:> select `month`, state, sum(order_total) as sales from orders group
by `month`, state
-       order by 3 desc limit 20;
+       0: jdbc:drill:> SELECT `month`, state, SUM(order_total)
+       AS sales FROM orders GROUP BY `month`, state
+       ORDER BY 3 DESC LIMIT 20;
        +------------+------------+------------+
        |   month    |   state    |   sales    |
        +------------+------------+------------+

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/085-offset-clause.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/085-offset-clause.md b/_docs/sql-reference/sql-commands/085-offset-clause.md
index 92ee478..8eb2f05 100755
--- a/_docs/sql-reference/sql-commands/085-offset-clause.md
+++ b/_docs/sql-reference/sql-commands/085-offset-clause.md
@@ -7,13 +7,10 @@ The OFFSET clause provides a way to skip a specified number of first rows
in a r
 ## Syntax
 The OFFSET clause supports the following syntax:
 
-       [ OFFSET start { ROW | ROWS } ]
-
-Specifying ALL returns all records, which is equivalent to omitting the LIMIT clause from
the SELECT statement.
+       OFFSET start { ROW | ROWS }
 
 ## Parameters
 *rows*  
-
 Specifies the number of rows Drill should skip before returning the result set. 
 
 ## Usage Notes  

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/087-union-set-operator.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/087-union-set-operator.md b/_docs/sql-reference/sql-commands/087-union-set-operator.md
index d55c50e..68558b9 100755
--- a/_docs/sql-reference/sql-commands/087-union-set-operator.md
+++ b/_docs/sql-reference/sql-commands/087-union-set-operator.md
@@ -26,9 +26,10 @@ Any SELECT query that Drill supports. See SELECT.
 ## Examples
 The following example uses the UNION ALL set operator to combine click activity data before
and after a marketing campaign. The data in the example exists in the `dfs.clicks workspace`.
  
-       0: jdbc:drill:> select t.trans_id transaction, t.user_info.cust_id customer from
`clicks/clicks.campaign.json` t 
-       union all 
-       select u.trans_id, u.user_info.cust_id  from `clicks/clicks.json` u limit 5;
+       0: jdbc:drill:> SELECT t.trans_id transaction, t.user_info.cust_id customer 
+       FROM `clicks/clicks.campaign.json` t 
+       UNION ALL
+       SELECT u.trans_id, u.user_info.cust_id FROM `clicks/clicks.json` u LIMIT 5;
        +-------------+------------+
        | transaction |  customer  |
        +-------------+------------+

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/088-where-clause.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/088-where-clause.md b/_docs/sql-reference/sql-commands/088-where-clause.md
index d233d6d..18a9c7d 100755
--- a/_docs/sql-reference/sql-commands/088-where-clause.md
+++ b/_docs/sql-reference/sql-commands/088-where-clause.md
@@ -28,11 +28,11 @@ A boolean expression can include one or more of the following operators:
 ## Examples
 The following query compares order totals where the states are California and New York: 

 
-       0: jdbc:drill:> select o1.cust_id, sum(o1.order_total) as ny_sales,
-       (select sum(o2.order_total) from hive.orders o2
-       where o1.cust_id=o2.cust_id and state='ca') as ca_sales
-       from hive.orders o1 where o1.state='ny' group by o1.cust_id
-       order by cust_id limit 20;
+       0: jdbc:drill:> SELECT o1.cust_id, sum(o1.order_total) AS ny_sales,
+       (SELECT SUM(o2.order_total) FROM hive.orders o2
+       WHERE o1.cust_id=o2.cust_id and state='ca') AS ca_sales
+       FROM hive.orders o1 WHERE o1.state='ny' GROUP BY o1.cust_id
+       ORDER BY cust_id LIMIT 20;
        +------------+------------+------------+
        |  cust_id   |  ny_sales  |  ca_sales  |
        +------------+------------+------------+

http://git-wip-us.apache.org/repos/asf/drill/blob/1e05eb3e/_docs/sql-reference/sql-commands/089-with-clause.md
----------------------------------------------------------------------
diff --git a/_docs/sql-reference/sql-commands/089-with-clause.md b/_docs/sql-reference/sql-commands/089-with-clause.md
index 5accdce..2b5ca89 100755
--- a/_docs/sql-reference/sql-commands/089-with-clause.md
+++ b/_docs/sql-reference/sql-commands/089-with-clause.md
@@ -17,20 +17,17 @@ The WITH clause supports the following syntax:
 
 ## Parameters
 
-_with\_subquery\_table\_name_
-
+*with_subquery_table_name*  
 A unique name for a temporary table that defines the results of a WITH clause
 subquery. You cannot use duplicate names within a single WITH clause. You must
 give each subquery a table name that can be referenced in the FROM clause.
 
-_column\_name_
-
+*column_name*  
 An optional list of output column names for the WITH clause subquery,
 separated by commas. The number of column names specified must be equal to or
 less than the number of columns defined by the subquery.
 
-_query_
-
+query  
 Any SELECT query that Drill supports. See
 [SELECT]({{ site.baseurl }}/docs/SELECT+Statements).
 
@@ -44,12 +41,9 @@ reuse the results for query optimization.
 
 You can use a WITH clause in the following SQL statements:
 
-  * SELECT (including subqueries within SELECT statements)
-
-  * CREATE TABLE AS
-
-  * CREATE VIEW
-
+  * SELECT (including subqueries within SELECT statements)  
+  * CREATE TABLE AS
+  * CREATE VIEW
   * EXPLAIN
 
 You can reference the temporary tables in the FROM clause of the query. If the


Mime
View raw message