You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by me...@apache.org on 2017/08/26 04:35:31 UTC

[beam-site] branch mergebot updated (db3f3b9 -> ec83da1)

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

mergebot-role pushed a change to branch mergebot
in repository https://gitbox.apache.org/repos/asf/beam-site.git.


 discard db3f3b9  This closes #300
 discard f5c30d6  correct the syntax of ORDER_BY LIMIT
 discard ba868d8  add SQL grammar in BNF
     new c51fa52  add SQL grammar in BNF
     new 3e8980e  correct the syntax of ORDER_BY LIMIT
     new ec83da1  This closes #300

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (db3f3b9)
            \
             N -- N -- N   refs/heads/mergebot (ec83da1)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:

-- 
To stop receiving notification emails like this one, please contact
['"commits@beam.apache.org" <co...@beam.apache.org>'].

[beam-site] 03/03: This closes #300

Posted by me...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mergebot-role pushed a commit to branch mergebot
in repository https://gitbox.apache.org/repos/asf/beam-site.git

commit ec83da18e54edb2627a430c584102df9bacbaa33
Merge: dbb8f55 3e8980e
Author: Mergebot <me...@apache.org>
AuthorDate: Sat Aug 26 04:35:19 2017 +0000

    This closes #300

 src/documentation/dsls/sql.md | 73 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 59 insertions(+), 14 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
"commits@beam.apache.org" <co...@beam.apache.org>.

[beam-site] 02/03: correct the syntax of ORDER_BY LIMIT

Posted by me...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mergebot-role pushed a commit to branch mergebot
in repository https://gitbox.apache.org/repos/asf/beam-site.git

commit 3e8980e4ec3f84dd38397f0d28aa52ea3bf12a07
Author: mingmxu <mi...@ebay.com>
AuthorDate: Fri Aug 25 16:40:18 2017 -0700

    correct the syntax of ORDER_BY LIMIT
---
 src/documentation/dsls/sql.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/documentation/dsls/sql.md b/src/documentation/dsls/sql.md
index 5a7ad32..5c9308a 100644
--- a/src/documentation/dsls/sql.md
+++ b/src/documentation/dsls/sql.md
@@ -122,7 +122,7 @@ query:
       |   query MINUS [ ALL ] query
       |   query INTERSECT [ ALL ] query
 	}
-    [ ORDER BY orderItem [, orderItem ]* LIMIT [offset] count ]
+    [ ORDER BY orderItem [, orderItem ]* LIMIT count [OFFSET offset] ]
 
 orderItem:
       expression [ ASC | DESC ]

-- 
To stop receiving notification emails like this one, please contact
"commits@beam.apache.org" <co...@beam.apache.org>.

[beam-site] 01/03: add SQL grammar in BNF

Posted by me...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mergebot-role pushed a commit to branch mergebot
in repository https://gitbox.apache.org/repos/asf/beam-site.git

commit c51fa520869fd06e8b7b0f35451de83fccadf105
Author: mingmxu <mi...@ebay.com>
AuthorDate: Thu Aug 24 13:39:47 2017 -0700

    add SQL grammar in BNF
---
 src/documentation/dsls/sql.md | 73 ++++++++++++++++++++++++++++++++++---------
 1 file changed, 59 insertions(+), 14 deletions(-)

diff --git a/src/documentation/dsls/sql.md b/src/documentation/dsls/sql.md
index ce893cd..5a7ad32 100644
--- a/src/documentation/dsls/sql.md
+++ b/src/documentation/dsls/sql.md
@@ -112,18 +112,65 @@ Both methods wrap the back-end details of parsing/validation/assembling, and del
 [BeamSqlExample](https://github.com/apache/beam/blob/DSL_SQL/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/example/BeamSqlExample.java) in the code repository shows basic usage of both APIs.
 
 # <a name="functionality"></a>3. Functionality in Beam SQL
-Just as the unified model for both bounded and unbounded data in Beam, SQL DSL provides the same functionalities for bounded and unbounded `PCollection` as well. 
+Just as the unified model for both bounded and unbounded data in Beam, SQL DSL provides the same functionalities for bounded and unbounded `PCollection` as well. Here's the supported SQL grammar supported in [BNF](http://en.wikipedia.org/wiki/Backus%E2%80%93Naur_Form)-like form. An `UnsupportedOperationException` is thrown for unsupported features.
 
-Note that, SQL support is not fully completed. Queries that include unsupported features would cause an `UnsupportedOperationException`.
-
-## <a name="features"></a>3.1. Supported Features
-The following features are supported in current repository:
+```
+query:
+	{
+          select
+      |   query UNION [ ALL ] query
+      |   query MINUS [ ALL ] query
+      |   query INTERSECT [ ALL ] query
+	}
+    [ ORDER BY orderItem [, orderItem ]* LIMIT [offset] count ]
+
+orderItem:
+      expression [ ASC | DESC ]
+
+select:
+      SELECT
+          { * | projectItem [, projectItem ]* }
+      FROM tableExpression
+      [ WHERE booleanExpression ]
+      [ GROUP BY { groupItem [, groupItem ]* } ]
+      [ HAVING booleanExpression ]
+
+projectItem:
+      expression [ [ AS ] columnAlias ]
+  |   tableAlias . *
+
+tableExpression:
+      tableReference [, tableReference ]*
+  |   tableExpression [ ( LEFT | RIGHT ) [ OUTER ] ] JOIN tableExpression [ joinCondition ]
+
+booleanExpression:
+    expression [ IS NULL | IS NOT NULL ]
+  | expression [ > | >= | = | < | <= | <> ] expression
+  | booleanExpression [ AND | OR ] booleanExpression 
+  | NOT booleanExpression
+  | '(' booleanExpression ')'
+
+joinCondition:
+      ON booleanExpression
+
+tableReference:
+      tableName [ [ AS ] alias ]
+
+values:
+      VALUES expression [, expression ]*
+
+groupItem:
+      expression
+  |   '(' expression [, expression ]* ')'
+  |   HOP '(' expression [, expression ]* ')'
+  |   TUMBLE '(' expression [, expression ]* ')'
+  |   SESSION '(' expression [, expression ]* ')'
 
-**1. filter clauses;**
+```
 
-**2. data field projections;**
+## <a name="features"></a>3.1. Supported Features
 
-**3. aggregations;**
+**1. aggregations;**
 
 Beam SQL supports aggregation functions with group_by in global_window, fixed_window, sliding_window and session_window. A field with type `TIMESTAMP` is required to specify fixed_window/sliding_window/session_window. The field is used as event timestamp for rows. See below for several examples:
 
@@ -149,7 +196,7 @@ Repeatedly.forever(AfterWatermark.pastEndOfWindow().withLateFirings(AfterProcess
         .pastFirstElementInPane().plusDelayOf(Duration.millis(delayTime.getTimeInMillis()))));
 ```		
 
-**4. Join (inner, left_outer, right_outer);**
+**2. Join (inner, left_outer, right_outer);**
 
 The scenarios of join can be categorized into 3 cases:
 
@@ -164,9 +211,7 @@ For case 1 and case 2, a standard join is utilized as long as the windowFn of th
 * If it's a LEFT OUTER JOIN, the unbounded table should on the left side; If it's a RIGHT OUTER JOIN, the unbounded table should on the right side;
 * window/trigger is inherented from upstreams, which should be consistent;
 
-**5. built-in SQL functions**
-
-**6. User Defined Function (UDF) and User Defined Aggregate Function (UDAF);**
+**3. User Defined Function (UDF) and User Defined Aggregate Function (UDAF);**
 
 If the required function is not available, developers can register their own UDF(for scalar function) and UDAF(for aggregation function).
 
@@ -245,7 +290,7 @@ PCollection<BeamSqlRow> result =
         BeamSql.simpleQuery(sql).withUdaf("squaresum", new SquareSum()));
 ```
   
-## <a name="data-type"></a>3.3. Data Types
+## <a name="data-type"></a>3.2. Data Types
 Each type in Beam SQL maps to a Java class to holds the value in `BeamRecord`. The following table lists the relation between SQL types and Java classes, which are supported in current repository:
 
 | SQL Type | Java class |
@@ -261,7 +306,7 @@ Each type in Beam SQL maps to a Java class to holds the value in `BeamRecord`. T
 | Types.TIMESTAMP | java.util.Date |
 {:.table}
 
-## <a name="built-in-functions"></a>3.4. built-in SQL functions
+## <a name="built-in-functions"></a>3.3. built-in SQL functions
 
 Beam SQL has implemented lots of build-in functions defined in [Apache Calcite](http://calcite.apache.org). The available functions are listed as below:
 

-- 
To stop receiving notification emails like this one, please contact
"commits@beam.apache.org" <co...@beam.apache.org>.