You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by gi...@apache.org on 2019/10/11 02:17:41 UTC
[beam] branch asf-site updated: Publishing website 2019/10/11
02:17:28 at commit b288d5a
This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/asf-site by this push:
new eafded3 Publishing website 2019/10/11 02:17:28 at commit b288d5a
eafded3 is described below
commit eafded3c80212d514f8d8a3ed34072d0a707d265
Author: jenkins <bu...@apache.org>
AuthorDate: Fri Oct 11 02:17:28 2019 +0000
Publishing website 2019/10/11 02:17:28 at commit b288d5a
---
.../sql/calcite/aggregate-functions/index.html | 33 +-
.../dsls/sql/calcite/data-types/index.html | 34 +-
.../dsls/sql/calcite/lexical/index.html | 32 +-
.../dsls/sql/calcite/overview/index.html | 45 +-
.../dsls/sql/calcite/query-syntax/index.html | 31 +-
.../dsls/sql/calcite/scalar-functions/index.html | 33 +-
.../extensions/create-external-table/index.html | 23 +
.../dsls/sql/extensions/joins/index.html | 23 +
.../dsls/sql/extensions/set/index.html | 23 +
.../extensions/user-defined-functions/index.html | 23 +
.../extensions/windowing-and-triggering/index.html | 23 +
.../documentation/dsls/sql/overview/index.html | 54 +-
.../documentation/dsls/sql/shell/index.html | 23 +
.../documentation/dsls/sql/walkthrough/index.html | 23 +
.../aggregate-functions/index.html | 254 ++-
.../conditional-expressions}/index.html | 154 +-
.../sql/zetasql/conversion-rules}/index.html | 228 ++-
.../data-types}/index.html | 802 +++++-----
.../sql/{calcite => zetasql}/lexical/index.html | 1066 ++++---------
.../math-functions}/index.html | 165 +-
.../operators}/index.html | 837 ++++++----
.../sql/{calcite => zetasql}/overview/index.html | 108 +-
.../dsls/sql/zetasql/query-syntax/index.html | 1621 ++++++++++++++++++++
.../string-functions}/index.html | 1044 ++++++++-----
.../{extensions/set => zetasql/syntax}/index.html | 83 +-
.../sdks/feature-comparison/index.html | 23 +
.../documentation/sdks/go/index.html | 23 +
.../sdks/java-dependencies/index.html | 23 +
.../documentation/sdks/java-extensions/index.html | 23 +
.../documentation/sdks/java-thirdparty/index.html | 23 +
.../documentation/sdks/java/euphoria/index.html | 23 +
.../documentation/sdks/java/index.html | 23 +
.../sdks/java/testing/nexmark/index.html | 23 +
.../sdks/python-dependencies/index.html | 23 +
.../sdks/python-pipeline-dependencies/index.html | 23 +
.../documentation/sdks/python-streaming/index.html | 23 +
.../sdks/python-type-safety/index.html | 23 +
.../documentation/sdks/python/index.html | 23 +
38 files changed, 4988 insertions(+), 2096 deletions(-)
diff --git a/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html b/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
index cba0743..f5b703d 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
+++ b/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL aggregate functions for Calcite</title>
+ <title>Beam Calcite SQL aggregate functions</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -279,13 +302,9 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-aggregate-functions-calcite">Beam SQL aggregate functions (Calcite)</h1>
-
-<p>This page documents built-in functions supported by Beam SQL when using Apache Calcite.</p>
+<h1 id="beam-calcite-sql-aggregate-functions">Beam Calcite SQL aggregate functions</h1>
-<p>See also <a href="http://calcite.apache.org/docs/reference.html#operators-and-functions">Calcite
-SQL’s operators and functions
-reference</a>.</p>
+<p>This page documents Apache Calcite aggregate functions supported by Beam Calcite SQL.</p>
<table class="table">
<thead>
diff --git a/website/generated-content/documentation/dsls/sql/calcite/data-types/index.html b/website/generated-content/documentation/dsls/sql/calcite/data-types/index.html
index 5abab6d..0c58621 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/data-types/index.html
+++ b/website/generated-content/documentation/dsls/sql/calcite/data-types/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL data types for Calcite</title>
+ <title>Beam Calcite SQL data types</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -279,13 +302,13 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-data-types-calcite">Beam SQL data types (Calcite)</h1>
+<h1 id="beam-calcite-sql-data-types">Beam Calcite SQL data types</h1>
<p>Beam SQL supports standard SQL scalar data types as well as extensions
including arrays, maps, and nested rows. This page documents supported
-data types in Beam SQL when using Apache Calcite.</p>
+<a href="http://calcite.apache.org/docs/reference.html#data-types">Apache Calcite data types</a> supported by Beam Calcite SQL.</p>
-<p>In Beam Java, these types are mapped to Java types large enough to hold the
+<p>In Java, these types are mapped to Java types large enough to hold the
full range of values.</p>
<table class="table">
@@ -360,9 +383,6 @@ full range of values.</p>
</tbody>
</table>
-<p>See also the <a href="http://calcite.apache.org/docs/reference.html#data-types">documentation for Calcite SQL’s data
-types</a></p>
-
</div>
</div>
<!--
diff --git a/website/generated-content/documentation/dsls/sql/calcite/lexical/index.html b/website/generated-content/documentation/dsls/sql/calcite/lexical/index.html
index 0abe410..8c31a65 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/lexical/index.html
+++ b/website/generated-content/documentation/dsls/sql/calcite/lexical/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL lexical structure for Calcite</title>
+ <title>Beam Calcite SQL lexical structure</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -303,13 +326,12 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-lexical-structure-calcite">Beam SQL lexical structure (Calcite)</h1>
+<h1 id="beam-calcite-sql-lexical-structure">Beam Calcite SQL lexical structure</h1>
-<p>A Beam SQL statement comprises a series of tokens. Tokens include
+<p>A Beam Calcite SQL statements are comprised of a series of tokens. Tokens include
<em>identifiers,</em> <em>quoted identifiers, literals</em>, <em>keywords</em>, <em>operators</em>,
and <em>special characters</em>. Tokens can be separated by whitespace (space,
-backspace, tab, newline) or comments. This page documents Beam SQL’s
-lexical structure when using Apache Calcite.</p>
+backspace, tab, newline) or comments.</p>
<h2 id="identifiers">Identifiers</h2>
diff --git a/website/generated-content/documentation/dsls/sql/calcite/overview/index.html b/website/generated-content/documentation/dsls/sql/calcite/overview/index.html
index 43989c1..e4e7aa6 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/overview/index.html
+++ b/website/generated-content/documentation/dsls/sql/calcite/overview/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL in Calcite: Overview</title>
+ <title>Beam Calcite SQL overview</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -284,30 +307,24 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="calcite-support-overview">Calcite support overview</h1>
+<h1 id="beam-calcite-sql-overview">Beam Calcite SQL overview</h1>
<p><a href="http://calcite.apache.org">Apache Calcite</a> is a widespread SQL dialect used in
-big data processing with some streaming enhancements. Calcite provides the
-basic dialect underlying Beam SQL.</p>
+big data processing with some streaming enhancements. Beam Calcite SQL is the default Beam SQL dialect.</p>
-<p>We have added additional extensions to
-make it easy to leverage Beam’s unified batch/streaming model and support
-for complex data types.</p>
+<p>Beam SQL has additional extensions leveraging Beam’s unified batch/streaming model and processing complex data types. You can use these extensions with all Beam SQL dialects, including Beam Calcite SQL.</p>
<h2 id="query-syntax">Query syntax</h2>
-<p>Query statements scan one or more tables or expressions and return the computed result rows.
-The <a href="/documentation/dsls/sql/calcite/query-syntax">Query syntax</a> page describes Beam SQL’s syntax for queries when using Apache Calcite.</p>
+<p>Query statements scan one or more tables or expressions and return the computed result rows. For more information about query statements in Beam Calcite SQL, see the <a href="/documentation/dsls/sql/calcite/query-syntax">Query syntax</a> reference.</p>
<h2 id="lexical-structure">Lexical structure</h2>
-<p>A Beam SQL statement comprises a series of tokens.
-The <a href="/documentation/dsls/sql/calcite/lexical">Lexical structure</a> page documents Beam SQL’s lexical structure when using Apache Calcite.</p>
+<p>A Beam SQL statement comprises a series of tokens. For more information about tokens in Beam Calcite SQL, see the <a href="/documentation/dsls/sql/calcite/lexical">Lexical structure</a> reference.</p>
<h2 id="data-types">Data types</h2>
-<p>Beam SQL supports standard SQL scalar data types as well as extensions including arrays, maps, and nested rows.
-Read about supported <a href="/documentation/dsls/sql/calcite/data-types">data types</a> in Beam SQL when using Apache Calcite.</p>
+<p>Beam SQL supports standard SQL scalar data types as well as extensions including arrays, maps, and nested rows. For more information about scalar data in Beam Calcite SQL, see the <a href="/documentation/dsls/sql/calcite/data-types">Data types</a> reference.</p>
<h2 id="functions-and-operators">Functions and operators</h2>
-<p>The following table summarizes Apache Calcite operators and functions supported by Beam SQL.</p>
+<p>The following table summarizes the Apache Calcite functions and operators supported by Beam Calcite SQL.</p>
<table class="table-bordered table-striped">
<tr><th>Operators and functions</th><th>Beam SQL support status</th></tr>
diff --git a/website/generated-content/documentation/dsls/sql/calcite/query-syntax/index.html b/website/generated-content/documentation/dsls/sql/calcite/query-syntax/index.html
index 7be7d65..11f7e2c 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/query-syntax/index.html
+++ b/website/generated-content/documentation/dsls/sql/calcite/query-syntax/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL query syntax for Calcite</title>
+ <title>Beam Calcite SQL query syntax</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -348,12 +371,12 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-query-syntax-calcite">Beam SQL query syntax (Calcite)</h1>
+<h1 id="beam-calcite-sql-query-syntax">Beam Calcite SQL query syntax</h1>
<p>Query statements scan one or more tables or expressions and return the computed
-result rows. This page documents Beam SQL’s syntax for queries when using Apache Calcite.</p>
+result rows.</p>
-<p>Generally, the semantics of queries is standard. Please see the following
+<p>Generally, the semantics of queries is standard. See the following
sections to learn about extensions for supporting Beam’s unified
batch/streaming model:</p>
diff --git a/website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html b/website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html
index 6fbe68f..e026a39 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html
+++ b/website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL scalar functions in Calcite</title>
+ <title>Beam Calcite SQL scalar functions</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -288,13 +311,9 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-scalar-functions-calcite">Beam SQL scalar functions (Calcite)</h1>
-
-<p>This page documents built-in functions supported by Beam SQL when using Apache Calcite.</p>
+<h1 id="beam-calcite-sql-scalar-functions">Beam Calcite SQL scalar functions</h1>
-<p>See also <a href="http://calcite.apache.org/docs/reference.html#operators-and-functions">Calcite
-SQL’s operators and functions
-reference</a>.</p>
+<p>This page documents the Apache Calcite functions supported by Beam Calcite SQL.</p>
<h2 id="comparison-functions-and-operators">Comparison functions and operators</h2>
diff --git a/website/generated-content/documentation/dsls/sql/extensions/create-external-table/index.html b/website/generated-content/documentation/dsls/sql/extensions/create-external-table/index.html
index 4b22d00..133a8e5 100644
--- a/website/generated-content/documentation/dsls/sql/extensions/create-external-table/index.html
+++ b/website/generated-content/documentation/dsls/sql/extensions/create-external-table/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/dsls/sql/extensions/joins/index.html b/website/generated-content/documentation/dsls/sql/extensions/joins/index.html
index 0ffe641..1549b28 100644
--- a/website/generated-content/documentation/dsls/sql/extensions/joins/index.html
+++ b/website/generated-content/documentation/dsls/sql/extensions/joins/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/dsls/sql/extensions/set/index.html b/website/generated-content/documentation/dsls/sql/extensions/set/index.html
index 45afb30..a9408ff 100644
--- a/website/generated-content/documentation/dsls/sql/extensions/set/index.html
+++ b/website/generated-content/documentation/dsls/sql/extensions/set/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/dsls/sql/extensions/user-defined-functions/index.html b/website/generated-content/documentation/dsls/sql/extensions/user-defined-functions/index.html
index 2ab76e2..df87e4b 100644
--- a/website/generated-content/documentation/dsls/sql/extensions/user-defined-functions/index.html
+++ b/website/generated-content/documentation/dsls/sql/extensions/user-defined-functions/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/dsls/sql/extensions/windowing-and-triggering/index.html b/website/generated-content/documentation/dsls/sql/extensions/windowing-and-triggering/index.html
index 2d780f2..12bb812 100644
--- a/website/generated-content/documentation/dsls/sql/extensions/windowing-and-triggering/index.html
+++ b/website/generated-content/documentation/dsls/sql/extensions/windowing-and-triggering/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/dsls/sql/overview/index.html b/website/generated-content/documentation/dsls/sql/overview/index.html
index 434303b..6266bb2 100644
--- a/website/generated-content/documentation/dsls/sql/overview/index.html
+++ b/website/generated-content/documentation/dsls/sql/overview/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -264,6 +287,7 @@
<li><a href="#walkthrough">Walkthrough</a></li>
<li><a href="#shell">Shell</a></li>
<li><a href="#apache-calcite-dialect">Apache Calcite dialect</a></li>
+ <li><a href="#zetasql-dialect">ZetaSQL dialect</a></li>
<li><a href="#beam-sql-extensions">Beam SQL extensions</a></li>
</ul>
@@ -292,9 +316,17 @@ bounded and unbounded <code class="highlighter-rouge">PCollections</code> with S
is translated to a <code class="highlighter-rouge">PTransform</code>, an encapsulated segment of a Beam pipeline.
You can freely mix SQL <code class="highlighter-rouge">PTransforms</code> and other <code class="highlighter-rouge">PTransforms</code> in your pipeline.</p>
-<p><a href="http://calcite.apache.org">Apache Calcite</a> is a widespread SQL dialect used in
-big data processing with some streaming enhancements. Calcite provides the
-basic dialect underlying Beam SQL.</p>
+<p>Beam SQL includes the following dialects:</p>
+
+<ul>
+ <li><a href="http://calcite.apache.org">Beam Calcite SQL</a></li>
+ <li><a href="https://github.com/google/zetasql">Beam ZetaSQL</a></li>
+</ul>
+
+<p>Beam Calcite SQL is a variant of Apache Calcite, a dialect widespread in
+big data processing. Beam Calcite SQL is the default Beam SQL dialect. Beam ZetaSQL is more compatible with BigQuery, so it’s especially useful in pipelines that <a href="https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.html">write to or read from BigQuery tables</a>.</p>
+
+<p>To change dialects, pass <a href="https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/extensions/sql/package-summary.html">the dialect’s full package name</a> to the <a href="https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/extensions/sql/impl/BeamSqlPipelineOptions.html#setPlannerName-java.lang.String-"><code class="highlighter-rouge">setPlannerName</code></a> method in the <a href="https://beam.apache.org/releases/javadoc/2.15.0/org/apache/beam/s [...]
<p>There are two additional concepts you need to know to use SQL in your pipeline:</p>
@@ -312,13 +344,19 @@ the type of elements that Beam SQL operates on. A <code class="highlighter-rouge
The <a href="/documentation/dsls/sql/shell">Shell page</a> describes how to work with the interactive Beam SQL shell.</p>
<h2 id="apache-calcite-dialect">Apache Calcite dialect</h2>
-<p>The <a href="/documentation/dsls/sql/calcite/overview">Calcite overview</a> summarizes Apache Calcite operators,
-functions, syntax, and data types supported by Beam SQL.</p>
+<p>The <a href="/documentation/dsls/sql/calcite/overview">Beam Calcite SQL overview</a> summarizes Apache Calcite operators,
+functions, syntax, and data types supported by Beam Calcite SQL.</p>
+
+<h2 id="zetasql-dialect">ZetaSQL dialect</h2>
+<p>For more information on the ZetaSQL features in Beam SQL, see the <a href="/documentation/dsls/sql/zetasql/overview">Beam ZetaSQL dialect reference</a>.</p>
+
+<p>To switch to Beam ZetaSQL, configure the <a href="https://beam.apache.org/releases/javadoc/2.15.0/org/apache/beam/sdk/options/PipelineOptions.html">pipeline options</a> as follows:</p>
+<div class="highlighter-rouge"><pre class="highlight"><code>setPlannerName("org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner")
+</code></pre>
+</div>
<h2 id="beam-sql-extensions">Beam SQL extensions</h2>
-<p>Beam SQL has additional <a href="/documentation/dsls/sql/extensions/create-external-table">extensions</a> to
-make it easy to leverage Beam’s unified batch/streaming model and support
-for complex data types.</p>
+<p>Beam SQL has additional extensions leveraging Beam’s unified batch/streaming model and processing complex data types. You can use these extensions with all Beam SQL dialects.</p>
</div>
</div>
diff --git a/website/generated-content/documentation/dsls/sql/shell/index.html b/website/generated-content/documentation/dsls/sql/shell/index.html
index 2865441..fbacb60 100644
--- a/website/generated-content/documentation/dsls/sql/shell/index.html
+++ b/website/generated-content/documentation/dsls/sql/shell/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/dsls/sql/walkthrough/index.html b/website/generated-content/documentation/dsls/sql/walkthrough/index.html
index 9ed7d87..d1ac76c 100644
--- a/website/generated-content/documentation/dsls/sql/walkthrough/index.html
+++ b/website/generated-content/documentation/dsls/sql/walkthrough/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html b/website/generated-content/documentation/dsls/sql/zetasql/aggregate-functions/index.html
similarity index 71%
copy from website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/aggregate-functions/index.html
index cba0743..1c4f4ab 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/aggregate-functions/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL aggregate functions for Calcite</title>
+ <title>Beam ZetaSQL aggregate functions</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/calcite/aggregate-functions/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/aggregate-functions/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/calcite/aggregate-functions.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/aggregate-functions.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -260,6 +283,13 @@
+<ul class="nav">
+ <li><a href="#avg">AVG</a></li>
+ <li><a href="#count">COUNT</a></li>
+ <li><a href="#max">MAX</a></li>
+ <li><a href="#min">MIN</a></li>
+ <li><a href="#sum">SUM</a></li>
+</ul>
</nav>
@@ -279,13 +309,9 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-aggregate-functions-calcite">Beam SQL aggregate functions (Calcite)</h1>
+<h1 id="beam-zetasql-aggregate-functions">Beam ZetaSQL aggregate functions</h1>
-<p>This page documents built-in functions supported by Beam SQL when using Apache Calcite.</p>
-
-<p>See also <a href="http://calcite.apache.org/docs/reference.html#operators-and-functions">Calcite
-SQL’s operators and functions
-reference</a>.</p>
+<p>This page documents the ZetaSQL aggregate functions supported by Beam ZetaSQL.</p>
<table class="table">
<thead>
@@ -296,28 +322,220 @@ reference</a>.</p>
</thead>
<tbody>
<tr>
- <td>COUNT(*)</td>
+ <td><a href="#count">COUNT(*)</a></td>
<td>Returns the number of input rows</td>
</tr>
<tr>
- <td>AVG(numeric)</td>
- <td>Returns the average (arithmetic mean) of numeric across all input values</td>
+ <td><a href="#avg">AVG(FLOAT64)</a></td>
+ <td>Returns the average of non-<code class="highlighter-rouge">NULL</code> input values</td>
</tr>
<tr>
- <td>SUM(numeric)</td>
- <td>Returns the sum of numeric across all input values</td>
+ <td><a href="#sum">SUM(numeric)</a></td>
+ <td>Returns the sum of non-<code class="highlighter-rouge">NULL</code> values</td>
</tr>
<tr>
- <td>MAX(value)</td>
- <td>Returns the maximum value of value across all input values</td>
+ <td><a href="#max">MAX(value)</a></td>
+ <td>Returns the maximum non-<code class="highlighter-rouge">NULL</code> value</td>
</tr>
<tr>
- <td>MIN(value)</td>
- <td>Returns the minimum value of value across all input values</td>
+ <td><a href="#min">MIN(value)</a></td>
+ <td>Returns the minimum non-<code class="highlighter-rouge">NULL</code> value</td>
</tr>
</tbody>
</table>
+<h2 id="avg">AVG</h2>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>AVG(expression)
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Returns the average of non-<code class="highlighter-rouge">NULL</code> input values.</p>
+
+<p><strong>Supported Argument Types</strong></p>
+
+<p>FLOAT64. Note that, for floating point input types, the return result
+is non-deterministic, which means you might receive a different result each time
+you use this function.</p>
+
+<p><strong>Returned Data Types</strong></p>
+
+<ul>
+ <li>FLOAT64</li>
+</ul>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>SELECT AVG(x) as avg
+FROM UNNEST([0, 2, NULL, 4, 4, 5]) as x;
+
++-----+
+| avg |
++-----+
+| 3 |
++-----+
+
+</code></pre>
+</div>
+
+<h2 id="count">COUNT</h2>
+
+<ol>
+ <li>
+ <p><code class="highlighter-rouge">COUNT(*)</code></p>
+ </li>
+ <li>
+ <p><code class="highlighter-rouge">COUNT(expression)</code></p>
+ </li>
+</ol>
+
+<p><strong>Description</strong></p>
+
+<ol>
+ <li>Returns the number of rows in the input.</li>
+ <li>Returns the number of rows with <code class="highlighter-rouge">expression</code> evaluated to any value other
+than <code class="highlighter-rouge">NULL</code>.</li>
+</ol>
+
+<p><strong>Supported Argument Types</strong></p>
+
+<p><code class="highlighter-rouge">expression</code> can be any data type.</p>
+
+<p><strong>Return Data Types</strong></p>
+
+<p>INT64</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>SELECT COUNT(*) AS count_star, COUNT(x) AS count_x
+FROM UNNEST([1, 4, NULL, 4, 5]) AS x;
+
++------------+---------+
+| count_star | count_x |
++------------+---------+
+| 5 | 4 |
++------------+---------+
+
+
+</code></pre>
+</div>
+
+<h2 id="max">MAX</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>MAX(expression)
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Returns the maximum value of non-<code class="highlighter-rouge">NULL</code> expressions. Returns <code class="highlighter-rouge">NULL</code> if there
+are zero input rows or <code class="highlighter-rouge">expression</code> evaluates to <code class="highlighter-rouge">NULL</code> for all rows.</p>
+
+<p><strong>Supported Argument Types</strong></p>
+
+<p>Any data type except:</p>
+<ul>
+ <li><code class="highlighter-rouge">ARRAY</code></li>
+ <li><code class="highlighter-rouge">STRUCT</code></li>
+</ul>
+
+<p><strong>Return Data Types</strong></p>
+
+<p>Same as the data type used as the input values.</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>SELECT MAX(x) AS max
+FROM UNNEST([8, NULL, 37, 4, NULL, 55]) AS x;
+
++-----+
+| max |
++-----+
+| 55 |
++-----+
+
+
+</code></pre>
+</div>
+
+<h2 id="min">MIN</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>MIN(expression)
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Returns the minimum value of non-<code class="highlighter-rouge">NULL</code> expressions. Returns <code class="highlighter-rouge">NULL</code> if there
+are zero input rows or <code class="highlighter-rouge">expression</code> evaluates to <code class="highlighter-rouge">NULL</code> for all rows.</p>
+
+<p><strong>Supported Argument Types</strong></p>
+
+<p>Any data type except:</p>
+<ul>
+ <li><code class="highlighter-rouge">ARRAY</code></li>
+ <li><code class="highlighter-rouge">STRUCT</code></li>
+</ul>
+
+<p><strong>Return Data Types</strong></p>
+
+<p>Same as the data type used as the input values.</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>SELECT MIN(x) AS min
+FROM UNNEST([8, NULL, 37, 4, NULL, 55]) AS x;
+
++-----+
+| min |
++-----+
+| 4 |
++-----+
+
+
+</code></pre>
+</div>
+
+<h2 id="sum">SUM</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>SUM(expression)
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Returns the sum of non-null values.</p>
+
+<p>If the expression is a floating point value, the sum is non-deterministic, which means you might receive a different result each time you use this function.</p>
+
+<p><strong>Supported Argument Types</strong></p>
+
+<p>Any supported numeric data types.</p>
+
+<p><strong>Return Data Types</strong></p>
+
+<ul>
+ <li>Returns INT64 if the input is an integer.</li>
+ <li>Returns FLOAT64 if the input is a floating point
+value.</li>
+</ul>
+
+<p>Returns <code class="highlighter-rouge">NULL</code> if the input contains only <code class="highlighter-rouge">NULL</code>s.</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>SELECT SUM(x) AS sum
+FROM UNNEST([1, 2, 3, 4, 5, 4, 3, 2, 1]) AS x;
+
++-----+
+| sum |
++-----+
+| 25 |
++-----+
+
+
+</code></pre>
+</div>
+
</div>
</div>
<!--
diff --git a/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html b/website/generated-content/documentation/dsls/sql/zetasql/conditional-expressions/index.html
similarity index 76%
copy from website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/conditional-expressions/index.html
index cba0743..da97815 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/conditional-expressions/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL aggregate functions for Calcite</title>
+ <title>Beam ZetaSQL conditional expressions</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/calcite/aggregate-functions/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/conditional-expressions/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/calcite/aggregate-functions.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/conditional-expressions.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -279,43 +302,100 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-aggregate-functions-calcite">Beam SQL aggregate functions (Calcite)</h1>
-
-<p>This page documents built-in functions supported by Beam SQL when using Apache Calcite.</p>
+<h1 id="beam-zetasql-conditional-expressions">Beam ZetaSQL conditional expressions</h1>
-<p>See also <a href="http://calcite.apache.org/docs/reference.html#operators-and-functions">Calcite
-SQL’s operators and functions
-reference</a>.</p>
+<p>This page documents the ZetaSQL scalar functions supported by Beam ZetaSQL.</p>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>COUNT(*)</td>
- <td>Returns the number of input rows</td>
- </tr>
- <tr>
- <td>AVG(numeric)</td>
- <td>Returns the average (arithmetic mean) of numeric across all input values</td>
- </tr>
- <tr>
- <td>SUM(numeric)</td>
- <td>Returns the sum of numeric across all input values</td>
- </tr>
- <tr>
- <td>MAX(value)</td>
- <td>Returns the maximum value of value across all input values</td>
- </tr>
- <tr>
- <td>MIN(value)</td>
- <td>Returns the minimum value of value across all input values</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Syntax</th>
+<th>Input Data Types</th>
+<th>Result Data Type</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+
+<tr>
+ <td><pre>CASE expr
+ WHEN value THEN result
+ [WHEN ...]
+ [ELSE else_result]
+ END</pre></td>
+<td><code>expr</code> and <code>value</code>: Any type</td>
+<td><code>result</code> and <code>else_result</code>: Supertype of input
+types.</td>
+<td>Compares <code>expr</code> to value of each successive <code>WHEN</code>
+clause and returns the first result where this comparison returns true. The
+remaining <code>WHEN</code> clauses and <code>else_result</code> are not
+evaluated. If the
+<code>expr = value</code> comparison returns false or <code>NULL</code> for
+all <code>WHEN</code> clauses, returns
+<code>else_result</code> if present; if not present, returns <code>NULL</code>.
+<code>expr</code> and <code>value</code> expressions
+must be implicitly coercible to a common supertype; equality comparisons are
+done on coerced values. <code>result</code> and <code>else_result</code>
+expressions must be coercible to a common supertype.</td>
+</tr>
+
+
+<tr>
+ <td><pre>CASE
+ WHEN cond1 THEN result
+ [WHEN cond2...]
+ [ELSE else_result]
+ END</pre></td>
+<td><code>cond</code>: BOOL</td>
+<td><code>result</code> and <code>else_result</code>: Supertype of input
+types.</td>
+<td>Evaluates condition <code>cond</code> of each successive <code>WHEN</code>
+clause and returns the first result where the condition is true; any remaining
+<code>WHEN</code> clauses and <code>else_result</code> are not evaluated. If all
+conditions are false or <code>NULL</code>, returns
+<code>else_result</code> if present; if not present, returns
+<code>NULL</code>. <code>result</code> and <code>else_result</code>
+expressions must be implicitly coercible to a common supertype. </td>
+</tr>
+
+<tr>
+<td><a id="coalesce"></a>COALESCE(expr1, ..., exprN)</td>
+<td>Any type</td>
+<td>Supertype of input types</td>
+<td>Returns the value of the first non-null expression. The remaining
+expressions are not evaluated. All input expressions must be implicitly
+coercible to a common supertype.</td>
+</tr>
+<tr>
+<td><a id="if"></a>IF(cond, true_result, else_result)</td>
+<td><code>cond</code>: BOOL</td>
+<td><code>true_result</code> and <code>else_result</code>: Any type.</td>
+<td>If <code>cond</code> is true, returns <code>true_result</code>, else returns
+<code>else_result</code>. <code>else_result</code> is not evaluated if
+<code>cond</code> is true. <code>true_result</code> is not evaluated if
+<code>cond</code> is false or <code>NULL</code>. <code>true_result</code> and
+<code>else_result</code> must be coercible to a common supertype.</td>
+</tr>
+<tr>
+<td><a id="ifnull"></a>IFNULL(expr, null_result)</td>
+<td>Any type</td>
+<td>Any type or supertype of input types.</td>
+<td>If <code>expr</code> is <code>NULL</code>, return <code>null_result</code>. Otherwise,
+return <code>expr</code>. If <code>expr</code> is not <code>NULL</code>,
+<code>null_result</code> is not evaluated. <code>expr</code> and
+<code>null_result</code> must be implicitly coercible to a common
+supertype. Synonym for <code>COALESCE(expr, null_result)</code>.</td>
+</tr>
+<tr>
+<td><a id="nullif"></a>NULLIF(expression, expression_to_match)</td>
+<td>Any type T or subtype of T</td>
+<td>Any type T or subtype of T</td>
+<td>Returns <code>NULL</code> if <code>expression = expression_to_match</code>
+is true, otherwise returns <code>expression</code>. <code>expression</code> and
+<code>expression_to_match</code> must be implicitly coercible to a common
+supertype; equality comparison is done on coerced values.</td>
+</tr>
+</tbody>
</table>
</div>
diff --git a/website/generated-content/documentation/sdks/java-extensions/index.html b/website/generated-content/documentation/dsls/sql/zetasql/conversion-rules/index.html
similarity index 74%
copy from website/generated-content/documentation/sdks/java-extensions/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/conversion-rules/index.html
index c720649..3b4bafa 100644
--- a/website/generated-content/documentation/sdks/java-extensions/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/conversion-rules/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam Java SDK Extensions</title>
+ <title>Beam ZetaSQL conversion rules</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/sdks/java-extensions/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/conversion-rules/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/sdks/java-extensions.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/conversion-rules.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -261,14 +284,8 @@
<ul class="nav">
- <li><a href="#join-library">Join-library</a></li>
- <li><a href="#sorter">Sorter</a>
- <ul>
- <li><a href="#caveats">Caveats</a></li>
- <li><a href="#options">Options</a></li>
- <li><a href="#example-usage-of-sortvalues">Example usage of <code class="highlighter-rouge">SortValues</code></a></li>
- </ul>
- </li>
+ <li><a href="#casting">Casting</a></li>
+ <li><a href="#coercion">Coercion</a></li>
</ul>
@@ -288,64 +305,177 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="apache-beam-java-sdk-extensions">Apache Beam Java SDK Extensions</h1>
-<h2 id="join-library">Join-library</h2>
+<h1 id="beam-zetasql-conversion-rules">Beam ZetaSQL conversion rules</h1>
-<p>Join-library provides inner join, outer left join, and outer right join functions. The aim
-is to simplify the most common cases of join to a simple function call.</p>
+<p>Conversion includes, but is not limited to, casting and coercion:</p>
-<p>The functions are generic and support joins of any Beam-supported types.
-Input to the join functions are <code class="highlighter-rouge">PCollections</code> of <code class="highlighter-rouge">Key</code> / <code class="highlighter-rouge">Value</code>s. Both
-the left and right <code class="highlighter-rouge">PCollection</code>s need the same type for the key. All the join
-functions return a <code class="highlighter-rouge">Key</code> / <code class="highlighter-rouge">Value</code> where <code class="highlighter-rouge">Key</code> is the join key and value is
-a <code class="highlighter-rouge">Key</code> / <code class="highlighter-rouge">Value</code> where the key is the left value and right is the value.</p>
+<ul>
+ <li>Casting is explicit conversion and uses the <code class="highlighter-rouge">CAST()</code> function.</li>
+ <li>Coercion is implicit conversion, which Beam SQL performs
+automatically under the conditions described below.</li>
+</ul>
-<p>For outer joins, the user must provide a value that represents <code class="highlighter-rouge">null</code> because <code class="highlighter-rouge">null</code>
-cannot be serialized.</p>
+<p>The table below summarizes all possible <code class="highlighter-rouge">CAST</code>s and coercions. “Coercion To” applies to all <em>expressions</em> of a given data type (e.g. a column).</p>
-<p>Example usage:</p>
+<table class="table">
+<thead>
+<tr>
+<th>From Type</th>
+<th>CAST to</th>
+<th>Coercion To</th>
+</tr>
+</thead>
+<tbody>
-<div class="highlighter-rouge"><pre class="highlight"><code>PCollection<KV<String, String>> leftPcollection = ...
-PCollection<KV<String, Long>> rightPcollection = ...
-PCollection<KV<String, KV<String, Long>>> joinedPcollection =
- Join.innerJoin(leftPcollection, rightPcollection);
-</code></pre>
-</div>
+<tr>
+<td>INT64</td>
+<td><span>INT64</span><br /><span>FLOAT64</span><br /><span>STRING</span><br /></td>
+<td><span>FLOAT64</span><br /></td>
+</tr>
-<h2 id="sorter">Sorter</h2>
+<tr>
+<td>FLOAT64</td>
+<td><span>FLOAT64</span><br /></td>
+<td> </td>
+</tr>
-<p>This module provides the <code class="highlighter-rouge">SortValues</code> transform, which takes a <code class="highlighter-rouge">PCollection<KV<K, Iterable<KV<K2, V>>>></code> and produces a <code class="highlighter-rouge">PCollection<KV<K, Iterable<KV<K2, V>>>></code> where, for each primary key <code class="highlighter-rouge">K</code> the paired <code class="highlighter-rouge">Iterable<KV<K2, V>></code> has been sorted b [...]
-<h3 id="caveats">Caveats</h3>
+<tr>
+<td>BOOL</td>
+<td><span>BOOL</span><br /></td>
+<td> </td>
+</tr>
-<ul>
- <li>This transform performs value-only sorting; the iterable accompanying each key is sorted, but <em>there is no relationship between different keys</em>, as Beam does not support any defined relationship between different elements in a <code class="highlighter-rouge">PCollection</code>.</li>
- <li>Each <code class="highlighter-rouge">Iterable<KV<K2, V>></code> is sorted on a single worker using local memory and disk. This means that <code class="highlighter-rouge">SortValues</code> may be a performance and/or scalability bottleneck when used in different pipelines. For example, users are discouraged from using <code class="highlighter-rouge">SortValues</code> on a <code class="highlighter-rouge">PCollection</code> of a single element to globally sort a large <cod [...]
-</ul>
-<h3 id="options">Options</h3>
+<tr>
+<td>STRING</td>
+<td><span>INT64</span><br /><span>STRING</span><br /><span>BYTES</span><br /><span>TIMESTAMP</span><br /></td>
+<td> </td>
+</tr>
-<ul>
- <li>The user can customize the temporary location used if sorting requires spilling to disk and the maximum amount of memory to use by creating a custom instance of <code class="highlighter-rouge">BufferedExternalSorter.Options</code> to pass into <code class="highlighter-rouge">SortValues.create</code>.</li>
-</ul>
-<h3 id="example-usage-of-sortvalues">Example usage of <code class="highlighter-rouge">SortValues</code></h3>
+<tr>
+<td>BYTES</td>
+<td><span>BYTES</span><br /><span>STRING</span><br /></td>
+<td> </td>
+</tr>
-<div class="highlighter-rouge"><pre class="highlight"><code>PCollection<KV<String, KV<String, Integer>>> input = ...
+<tr>
+<td>TIMESTAMP</td>
+<td><span>STRING</span><br /><span>TIMESTAMP</span><br /></td>
+<td> </td>
+</tr>
-// Group by primary key, bringing <SecondaryKey, Value> pairs for the same key together.
-PCollection<KV<String, Iterable<KV<String, Integer>>>> grouped =
- input.apply(GroupByKey.<String, KV<String, Integer>>create());
-// For every primary key, sort the iterable of <SecondaryKey, Value> pairs by secondary key.
-PCollection<KV<String, Iterable<KV<String, Integer>>>> groupedAndSorted =
- grouped.apply(
- SortValues.<String, String, Integer>create(BufferedExternalSorter.options()));
+<tr>
+<td>ARRAY</td>
+<td>ARRAY</td>
+<td> </td>
+</tr>
+
+
+
+<tr>
+<td>STRUCT</td>
+<td>STRUCT</td>
+<td> </td>
+</tr>
+
+
+</tbody>
+</table>
+
+<h2 id="casting">Casting</h2>
+
+<p>Syntax:</p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>CAST(expr AS typename)
</code></pre>
</div>
+<p>Cast syntax is used in a query to indicate that the result type of an
+expression should be converted to some other type.</p>
+
+<p>Example:</p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>CAST(x=1 AS STRING)
+</code></pre>
+</div>
+
+<p>This results in <code class="highlighter-rouge">"true"</code> if <code class="highlighter-rouge">x</code> is <code class="highlighter-rouge">1</code>, <code class="highlighter-rouge">"false"</code> for any other non-<code class="highlighter-rouge">NULL</code>
+value, and <code class="highlighter-rouge">NULL</code> if <code class="highlighter-rouge">x</code> is <code class="highlighter-rouge">NULL</code>.</p>
+
+<p>Casts between supported types that do not successfully map from the original
+value to the target domain produce runtime errors. For example, casting
+BYTES to STRING where the
+byte sequence is not valid UTF-8 results in a runtime error.</p>
+
+<p>When casting an expression <code class="highlighter-rouge">x</code> of the following types, these rules apply:</p>
+
+<table class="table">
+<tr>
+<th>From</th>
+<th>To</th>
+<th>Rule(s) when casting <code>x</code></th>
+</tr>
+<tr>
+<td>INT64</td>
+<td>FLOAT64</td>
+<td>Returns a close but potentially not exact
+FLOAT64
+value.</td>
+</tr>
+<tr>
+<td>FLOAT64</td>
+<td>STRING</td>
+<td>Returns an approximate string representation.<br />
+</td>
+</tr>
+<tr>
+<td>STRING</td>
+<td>BYTES</td>
+<td>STRINGs are cast to BYTES using UTF-8 encoding. For example, the STRING "©",
+when cast to BYTES, would become a 2-byte sequence with the hex values C2 and
+A9.</td>
+</tr>
+
+<tr>
+<td>BYTES</td>
+<td>STRING</td>
+<td>Returns <code>x</code> interpreted as a UTF-8 STRING.<br />
+For example, the BYTES literal
+<code>b'\xc2\xa9'</code>, when cast to STRING, is interpreted as UTF-8 and
+becomes the unicode character "©".<br />
+An error occurs if <code>x</code> is not valid UTF-8.</td>
+</tr>
+
+<tr>
+<td>ARRAY</td>
+<td>ARRAY</td>
+<td>Must be the exact same ARRAY type.</td>
+</tr>
+
+<tr>
+<td>STRUCT</td>
+<td>STRUCT</td>
+<td>Allowed if the following conditions are met:<br />
+<ol>
+<li>The two STRUCTs have the same number of fields.</li>
+<li>The original STRUCT field types can be explicitly cast to the corresponding
+target STRUCT field types (as defined by field order, not field name).</li>
+</ol>
+</td>
+</tr>
+
+</table>
+
+<h2 id="coercion">Coercion</h2>
+
+<p>Beam SQL coerces the result type of an expression to another type if
+needed to match function signatures. For example, if function func() is defined to take a single argument of type INT64 and an expression is used as an argument that has a result type of FLOAT64, then the result of the expression will be coerced to INT64 type before func() is computed.</p>
+
</div>
</div>
<!--
diff --git a/website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html b/website/generated-content/documentation/dsls/sql/zetasql/data-types/index.html
similarity index 53%
copy from website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/data-types/index.html
index 6fbe68f..f5eb275 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/data-types/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL scalar functions in Calcite</title>
+ <title>Beam ZetaSQL data types</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/calcite/scalar-functions/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/data-types/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/calcite/scalar-functions.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/data-types.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -261,13 +284,33 @@
<ul class="nav">
- <li><a href="#comparison-functions-and-operators">Comparison functions and operators</a></li>
- <li><a href="#logical-functions-and-operators">Logical functions and operators</a></li>
- <li><a href="#arithmetic-expressions">Arithmetic expressions</a></li>
- <li><a href="#math-functions">Math functions</a></li>
- <li><a href="#date-functions">Date functions</a></li>
- <li><a href="#string-functions">String functions</a></li>
- <li><a href="#conditional-functions">Conditional functions</a></li>
+ <li><a href="#data-type-properties">Data type properties</a></li>
+ <li><a href="#numeric-types">Numeric types</a>
+ <ul>
+ <li><a href="#integer-type">Integer type</a></li>
+ <li><a href="#floating-point-type">Floating point type</a></li>
+ </ul>
+ </li>
+ <li><a href="#boolean-type">Boolean type</a></li>
+ <li><a href="#string-type">String type</a></li>
+ <li><a href="#bytes-type">Bytes type</a></li>
+ <li><a href="#timestamp-type">Timestamp type</a>
+ <ul>
+ <li><a href="#canonical-format_2">Canonical format</a></li>
+ <li><a href="#time-zones">Time zones</a></li>
+ </ul>
+ </li>
+ <li><a href="#array-type">Array type</a>
+ <ul>
+ <li><a href="#declaring-an-array-type">Declaring an ARRAY type</a></li>
+ </ul>
+ </li>
+ <li><a href="#struct-type">Struct type</a>
+ <ul>
+ <li><a href="#declaring-a-struct-type">Declaring a STRUCT type</a></li>
+ <li><a href="#limited-comparisons-for-struct">Limited comparisons for STRUCT</a></li>
+ </ul>
+ </li>
</ul>
@@ -288,372 +331,431 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-scalar-functions-calcite">Beam SQL scalar functions (Calcite)</h1>
+<h1 id="beam-zetasql-lexical-structure">Beam ZetaSQL lexical structure</h1>
-<p>This page documents built-in functions supported by Beam SQL when using Apache Calcite.</p>
+<p>
+Beam ZetaSQL supports standard SQL scalar data types as well as extensions including arrays, maps, and nested rows. This page documents the ZetaSQL data types supported in Beam ZetaSQL.
+</p>
-<p>See also <a href="http://calcite.apache.org/docs/reference.html#operators-and-functions">Calcite
-SQL’s operators and functions
-reference</a>.</p>
+<h2 id="data-type-properties">Data type properties</h2>
-<h2 id="comparison-functions-and-operators">Comparison functions and operators</h2>
+<p>The following table contains data type properties and the data types that
+each property applies to:</p>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>value1 = value2</td>
- <td>Equals</td>
- </tr>
- <tr>
- <td>value1 <> value2</td>
- <td>Not equal</td>
- </tr>
- <tr>
- <td>value1 > value2</td>
- <td>Greater than</td>
- </tr>
- <tr>
- <td>value1 >= value2</td>
- <td>Greater than or equal</td>
- </tr>
- <tr>
- <td>value1 < value2</td>
- <td>Less than</td>
- </tr>
- <tr>
- <td>value1 <= value2</td>
- <td>Less than or equal</td>
- </tr>
- <tr>
- <td>value IS NULL</td>
- <td>Whether value is null</td>
- </tr>
- <tr>
- <td>value IS NOT NULL</td>
- <td>Whether value is not null</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Property</th>
+<th>Description</th>
+<th>Applies To</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Nullable</td>
+<td nowrap=""><code>NULL</code> is a valid value.</td>
+<td>
+All data types, with the following exceptions:
+<ul>
+<li>ARRAYs cannot be <code>NULL</code>.</li>
+<li><code>NULL ARRAY</code> elements cannot persist to a table.</li>
+<li>Queries cannot handle <code>NULL ARRAY</code> elements.</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td>Orderable</td>
+<td nowrap="">Can be used in an <code>ORDER BY</code> clause.</td>
+<td>All data types except for:
+<ul>
+<li>ARRAY</li>
+<li>STRUCT</li>
+</ul></td>
+</tr>
+<tr>
+<td>Groupable</td>
+<td nowrap="">Can generally appear in an expression following<br />
+<code>GROUP BY</code>, <code>DISTINCT</code>, or <code>PARTITION BY</code>.<br />
+ However, <code>PARTITION BY</code> expressions cannot include<br />
+ the floating point types <code>FLOAT</code> and <code>DOUBLE</code>.</br></br></br></td>
+<td>All data types except for:<ul>
+<li>ARRAY</li>
+<li>STRUCT</li>
+<li>FLOAT64</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td>Comparable</td>
+<td>Values of the same type can be compared to each other.</td>
+<td>All data types, with the following exceptions:
+
+ARRAY comparisons are not supported.
+
+<br /><br />
+Equality comparisons for STRUCTs are supported field by field, in field order.
+Field names are ignored. Less than and greater than comparisons are not
+supported.
+
+<br /><br />
+<br /><br />
+All types that support comparisons
+can be used in a <code>JOIN</code> condition. See
+<a href="/documentation/dsls/sql/zetasql/query-syntax#join_types">JOIN
+Types</a> for an explanation of join conditions.
+</td>
+</tr>
+</tbody>
</table>
-<h2 id="logical-functions-and-operators">Logical functions and operators</h2>
+<h2 id="numeric-types">Numeric types</h2>
-<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>boolean1 OR boolean2</td>
- <td>Whether boolean1 is TRUE or boolean2 is TRUE</td>
- </tr>
- <tr>
- <td>boolean1 AND boolean2</td>
- <td>Whether boolean1 and boolean2 are both TRUE</td>
- </tr>
- <tr>
- <td>NOT boolean</td>
- <td>Whether boolean is not TRUE; returns UNKNOWN if boolean is UNKNOWN</td>
- </tr>
- </tbody>
-</table>
+<p>Numeric types include integer types and floating point types.</p>
-<h2 id="arithmetic-expressions">Arithmetic expressions</h2>
+<h3 id="integer-type">Integer type</h3>
+
+<p>Integers are numeric values that do not have fractional components.</p>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>numeric1 + numeric2</td>
- <td>Returns numeric1 plus numeric2</td>
- </tr>
- <tr>
- <td>numeric1 - numeric2</td>
- <td>Returns numeric1 minus numeric2</td>
- </tr>
- <tr>
- <td>numeric1 * numeric2</td>
- <td>Returns numeric1 multiplied by numeric2</td>
- </tr>
- <tr>
- <td>numeric1 / numeric2</td>
- <td>Returns numeric1 divided by numeric2</td>
- </tr>
- <tr>
- <td>MOD(numeric, numeric)</td>
- <td>Returns the remainder (modulus) of numeric1 divided by numeric2. The result is negative only if numeric1 is negative</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Name</th>
+<th>Storage Size</th>
+<th>Range</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>INT64</code></td>
+<td>8 bytes</td>
+<td>-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807</td>
+</tr>
+</tbody>
</table>
-<h2 id="math-functions">Math functions</h2>
+<h3 id="floating-point-type">Floating point type</h3>
+
+<p>Floating point values are approximate numeric values with fractional components.</p>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>ABS(numeric)</td>
- <td>Returns the absolute value of numeric</td>
- </tr>
- <tr>
- <td>SQRT(numeric)</td>
- <td>Returns the square root of numeric</td>
- </tr>
- <tr>
- <td>LN(numeric)</td>
- <td>Returns the natural logarithm (base e) of numeric</td>
- </tr>
- <tr>
- <td>LOG10(numeric)</td>
- <td>Returns the base 10 logarithm of numeric</td>
- </tr>
- <tr>
- <td>EXP(numeric)</td>
- <td>Returns e raised to the power of numeric</td>
- </tr>
- <tr>
- <td>ACOS(numeric)</td>
- <td>Returns the arc cosine of numeric</td>
- </tr>
- <tr>
- <td>ASIN(numeric)</td>
- <td>Returns the arc sine of numeric</td>
- </tr>
- <tr>
- <td>ATAN(numeric)</td>
- <td>Returns the arc tangent of numeric</td>
- </tr>
- <tr>
- <td>COT(numeric)</td>
- <td>Returns the cotangent of numeric</td>
- </tr>
- <tr>
- <td>DEGREES(numeric)</td>
- <td>Converts numeric from radians to degrees</td>
- </tr>
- <tr>
- <td>RADIANS(numeric)</td>
- <td>Converts numeric from degrees to radians</td>
- </tr>
- <tr>
- <td>SIGN(numeric)</td>
- <td>Returns the signum of numeric</td>
- </tr>
- <tr>
- <td>SIN(numeric)</td>
- <td>Returns the sine of numeric</td>
- </tr>
- <tr>
- <td>TAN(numeric)</td>
- <td>Returns the tangent of numeric</td>
- </tr>
- <tr>
- <td>ROUND(numeric1, numeric2)</td>
- <td>Rounds numeric1 to numeric2 places right to the decimal point</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Name</th>
+<th>Storage Size</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>FLOAT64</code></td>
+<td>8 bytes</td>
+<td>Double precision (approximate) decimal values.</td>
+</tr>
+</tbody>
</table>
-<h2 id="date-functions">Date functions</h2>
-
+<h2 id="boolean-type">Boolean type</h2>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>LOCALTIME</td>
- <td>Returns the current date and time in the session time zone in a value of datatype TIME</td>
- </tr>
- <tr>
- <td>LOCALTIME(precision)</td>
- <td>Returns the current date and time in the session time zone in a value of datatype TIME, with precision digits of precision</td>
- </tr>
- <tr>
- <td>LOCALTIMESTAMP</td>
- <td>Returns the current date and time in the session time zone in a value of datatype TIMESTAMP</td>
- </tr>
- <tr>
- <td>LOCALTIMESTAMP(precision)</td>
- <td>Returns the current date and time in the session time zone in a value of datatype TIMESTAMP, with precision digits of precision</td>
- </tr>
- <tr>
- <td>CURRENT_TIME</td>
- <td>Returns the current time in the session time zone, in a value of datatype TIMESTAMP WITH TIME ZONE</td>
- </tr>
- <tr>
- <td>CURRENT_DATE</td>
- <td>Returns the current date in the session time zone, in a value of datatype DATE</td>
- </tr>
- <tr>
- <td>CURRENT_TIMESTAMP</td>
- <td>Returns the current date and time in the session time zone, in a value of datatype TIMESTAMP WITH TIME ZONE</td>
- </tr>
- <tr>
- <td>EXTRACT(timeUnit FROM datetime)</td>
- <td>Extracts and returns the value of a specified datetime field from a datetime value expression</td>
- </tr>
- <tr>
- <td>FLOOR(datetime TO timeUnit)</td>
- <td>Rounds datetime down to timeUnit</td>
- </tr>
- <tr>
- <td>CEIL(datetime TO timeUnit)</td>
- <td>Rounds datetime up to timeUnit</td>
- </tr>
- <tr>
- <td>YEAR(date)</td>
- <td>Equivalent to EXTRACT(YEAR FROM date). Returns an integer.</td>
- </tr>
- <tr>
- <td>QUARTER(date)</td>
- <td>Equivalent to EXTRACT(QUARTER FROM date). Returns an integer between 1 and 4.</td>
- </tr>
- <tr>
- <td>MONTH(date)</td>
- <td>Equivalent to EXTRACT(MONTH FROM date). Returns an integer between 1 and 12.</td>
- </tr>
- <tr>
- <td>WEEK(date)</td>
- <td>Equivalent to EXTRACT(WEEK FROM date). Returns an integer between 1 and 53.</td>
- </tr>
- <tr>
- <td>DAYOFYEAR(date)</td>
- <td>Equivalent to EXTRACT(DOY FROM date). Returns an integer between 1 and 366.</td>
- </tr>
- <tr>
- <td>DAYOFMONTH(date)</td>
- <td>Equivalent to EXTRACT(DAY FROM date). Returns an integer between 1 and 31.</td>
- </tr>
- <tr>
- <td>DAYOFWEEK(date)</td>
- <td>Equivalent to EXTRACT(DOW FROM date). Returns an integer between 1 and 7.</td>
- </tr>
- <tr>
- <td>HOUR(date)</td>
- <td>Equivalent to EXTRACT(HOUR FROM date). Returns an integer between 0 and 23.</td>
- </tr>
- <tr>
- <td>MINUTE(date)</td>
- <td>Equivalent to EXTRACT(MINUTE FROM date). Returns an integer between 0 and 59.</td>
- </tr>
- <tr>
- <td>SECOND(date)</td>
- <td>Equivalent to EXTRACT(SECOND FROM date). Returns an integer between 0 and 59.</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>BOOL</code></td>
+<td>Boolean values are represented by the keywords <code>TRUE</code> and
+<code>FALSE</code> (case insensitive).</td>
+</tr>
+</tbody>
</table>
-
-<h2 id="string-functions">String functions</h2>
+<h2 id="string-type">String type</h2>
+<table class="table">
+<thead>
+<tr>
+<th>Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>STRING</code></td>
+<td>Variable-length character (Unicode) data.</td>
+</tr>
+</tbody>
+</table>
+<p>Input STRING values must be UTF-8 encoded and output STRING values will be UTF-8
+encoded. Alternate encodings like CESU-8 and Modified UTF-8 are not treated as
+valid UTF-8.</p>
+<p>All functions and operators that act on STRING values operate on Unicode
+characters rather than bytes. For example, when functions like <code>SUBSTR</code> and <code>LENGTH</code>
+are applied to STRING input, the functions count Unicode characters, not bytes. Comparisons are
+defined on Unicode characters. Comparisons for less than and <code>ORDER BY</code> compare
+character by character, and lower unicode code points are considered lower
+characters.</p>
+
+<h2 id="bytes-type">Bytes type</h2>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>string || string</td>
- <td>Concatenates two character strings</td>
- </tr>
- <tr>
- <td>CHAR_LENGTH(string)</td>
- <td>Returns the number of characters in a character string</td>
- </tr>
- <tr>
- <td>CHARACTER_LENGTH(string)</td>
- <td>As CHAR_LENGTH(string)</td>
- </tr>
- <tr>
- <td>UPPER(string)</td>
- <td>Returns a character string converted to upper case</td>
- </tr>
- <tr>
- <td>LOWER(string)</td>
- <td>Returns a character string converted to lower case</td>
- </tr>
- <tr>
- <td>POSITION(string1 IN string2)</td>
- <td>Returns the position of the first occurrence of string1 in string2</td>
- </tr>
- <tr>
- <td>POSITION(string1 IN string2 FROM integer)</td>
- <td>Returns the position of the first occurrence of string1 in string2 starting at a given point (not standard SQL)</td>
- </tr>
- <tr>
- <td>TRIM( { BOTH | LEADING | TRAILING } string1 FROM string2)</td>
- <td>Removes the longest string containing only the characters in string1 from the start/end/both ends of string1</td>
- </tr>
- <tr>
- <td>OVERLAY(string1 PLACING string2 FROM integer [ FOR integer2 ])</td>
- <td>Replaces a substring of string1 with string2</td>
- </tr>
- <tr>
- <td>SUBSTRING(string FROM integer)</td>
- <td>Returns a substring of a character string starting at a given point</td>
- </tr>
- <tr>
- <td>SUBSTRING(string FROM integer FOR integer)</td>
- <td>Returns a substring of a character string starting at a given point with a given length</td>
- </tr>
- <tr>
- <td>INITCAP(string)</td>
- <td>Returns string with the first letter of each word converter to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters.</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>BYTES</code></td>
+<td>Variable-length binary data.</td>
+</tr>
+</tbody>
</table>
-<h2 id="conditional-functions">Conditional functions</h2>
+<p>STRING and BYTES are separate types that cannot be used interchangeably. Casts between STRING and BYTES enforce
+that the bytes are encoded using UTF-8.</p>
+
+<h2 id="timestamp-type">Timestamp type</h2>
+<p>Caution: SQL has millisecond <code class="highlighter-rouge">TIMESTAMP</code> precision. If a
+<code class="highlighter-rouge">TIMESTAMP</code> field has sub-millisecond precision, SQL
+throws an <code class="highlighter-rouge">IllegalArgumentException</code>.</p>
+
+<table class="table">
+<thead>
+<tr>
+<th>Name</th>
+<th>Description</th>
+<th>Range</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>TIMESTAMP</code></td>
+<td>Represents an absolute point in time, with
+ millisecond
+precision.</td>
+<td>0001-01-01 00:00:00 to 9999-12-31 23:59:59.999 UTC.</td>
+</tr>
+</tbody>
+</table>
+<p>A timestamp represents an absolute point in time, independent of any time zone
+or convention such as Daylight Savings Time.</p>
+
+<h3 id="canonical-format_2">Canonical format</h3>
+<pre class="codehilite"><code>YYYY-[M]M-[D]D[( |T)[H]H:[M]M:[S]S[.DDD]][time zone]</code></pre>
+<ul>
+<li><code>YYYY</code>: Four-digit year</li>
+<li><code>[M]M</code>: One or two digit month</li>
+<li><code>[D]D</code>: One or two digit day</li>
+<li><code>( |T)</code>: A space or a <code>T</code> separator</li>
+<li><code>[H]H</code>: One or two digit hour (valid values from 00 to 23)</li>
+<li><code>[M]M</code>: One or two digit minutes (valid values from 00 to 59)</li>
+<li><code>[S]S</code>: One or two digit seconds (valid values from 00 to 59)</li>
+<li><code>[.DDD]</code>: Up to three fractional digits (i.e. up to millisecond precision)</li>
+<li><code>[time zone]</code>: String representing the time zone. See the <a href="#time-zones">time zones</a>
+ section for details.</li>
+</ul>
+<p>Time zones are used when parsing timestamps or formatting timestamps for display.
+The timestamp value itself does not store a specific time zone. A
+string-formatted timestamp may include a time zone. When a time zone is not
+explicitly specified, the default time zone, UTC, is used.</p>
+<h3 id="time-zones">Time zones</h3>
+<p>Time zones are represented by strings in one of these two canonical formats:</p>
+<ul>
+<li>Offset from Coordinated Universal Time (UTC), or the letter <code>Z</code> for UTC</li>
+<li>Time zone name from the <a href="http://www.iana.org/time-zones">tz database</a></li>
+</ul>
+<h4 id="offset-from-coordinated-universal-time-utc">Offset from Coordinated Universal Time (UTC)</h4>
+<h5 id="offset-format">Offset Format</h5>
+<pre class="codehilite"><code>(+|-)H[H][:M[M]]
+Z</code></pre>
+<h5 id="examples">Examples</h5>
+<pre class="codehilite"><code>-08:00
+-8:15
++3:00
++07:30
+-7
+Z</code></pre>
+<p>When using this format, no space is allowed between the time zone and the rest
+of the timestamp.</p>
+<pre class="codehilite"><code>2014-09-27 12:30:00.45-8:00
+2014-09-27T12:30:00.45Z</code></pre>
+<h4 id="time-zone-name">Time zone name</h4>
+<p>Time zone names are from the <a href="http://www.iana.org/time-zones">tz database</a>. For a
+less comprehensive but simpler reference, see the
+<a href="http://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database time zones</a>
+on Wikipedia.</p>
+<h5 id="format">Format</h5>
+<pre class="codehilite"><code>continent/[region/]city</code></pre>
+<h5 id="examples_1">Examples</h5>
+<pre class="codehilite"><code>America/Los_Angeles
+America/Argentina/Buenos_Aires</code></pre>
+<p>When using a time zone name, a space is required between the name and the rest
+of the timestamp:</p>
+<pre class="codehilite"><code>2014-09-27 12:30:00.45 America/Los_Angeles</code></pre>
+<p>Note that not all time zone names are interchangeable even if they do happen to
+report the same time during a given part of the year. For example,
+<code>America/Los_Angeles</code> reports the same time as <code>UTC-7:00</code> during Daylight
+Savings Time, but reports the same time as <code>UTC-8:00</code> outside of Daylight
+Savings Time.</p>
+<p>If a time zone is not specified, the default time zone value is used.</p>
+<h4 id="leap-seconds">Leap seconds</h4>
+<p>A timestamp is simply an offset from 1970-01-01 00:00:00 UTC, assuming there are
+exactly 60 seconds per minute. Leap seconds are not represented as part of a
+stored timestamp.</p>
+<p>If your input contains values that use ":60" in the seconds field to represent a
+leap second, that leap second is not preserved when converting to a timestamp
+value. Instead that value is interpreted as a timestamp with ":00" in the
+seconds field of the following minute.</p>
+<p>Leap seconds do not affect timestamp computations. All timestamp computations
+are done using Unix-style timestamps, which do not reflect leap seconds. Leap
+seconds are only observable through functions that measure real-world time. In
+these functions, it is possible for a timestamp second to be skipped or repeated
+when there is a leap second.</p>
+<h2 id="array-type">Array type</h2>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>CASE value <br />WHEN value1 [, value11 ]* THEN result1 <br />[ WHEN valueN [, valueN1 ]* THEN resultN ]* <br />[ ELSE resultZ ] <br />END</td>
- <td>Simple case</td>
- </tr>
- <tr>
- <td>CASE <br />WHEN condition1 THEN result1 <br />[ WHEN conditionN THEN resultN ]* <br />[ ELSE resultZ ] <br />END</td>
- <td>Searched case</td>
- </tr>
- <tr>
- <td>NULLIF(value, value)</td>
- <td>Returns NULL if the values are the same. For example, NULLIF(5, 5) returns NULL; NULLIF(5, 0) returns 5.</td>
- </tr>
- <tr>
- <td>COALESCE(value, value [, value ]*)</td>
- <td>Provides a value if the first value is null. For example, COALESCE(NULL, 5) returns 5.</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>ARRAY</code></td>
+<td>Ordered list of zero or more elements of any non-ARRAY type.</td>
+</tr>
+</tbody>
</table>
+<p>An ARRAY is an ordered list of zero or more elements of non-ARRAY values.
+ARRAYs of ARRAYs are not allowed. Queries that would produce an ARRAY of
+ARRAYs will return an error. Instead a STRUCT must be inserted between the
+ARRAYs using the <code>SELECT AS STRUCT</code> construct.</p>
+<p>An empty ARRAY and a <code>NULL</code> ARRAY are two distinct values. ARRAYs can contain
+<code>NULL</code> elements.</p>
+<h3 id="declaring-an-array-type">Declaring an ARRAY type</h3>
+<p>ARRAY types are declared using the angle brackets (<code><</code> and <code>></code>). The type
+of the elements of an ARRAY can be arbitrarily complex with the exception that
+an ARRAY cannot directly contain another ARRAY.</p>
+<h4 id="format_1">Format</h4>
+<pre class="codehilite"><code>ARRAY<T></code></pre>
+<h4 id="examples_2">Examples</h4>
+<table class="table">
+<thead>
+<tr>
+<th>Type Declaration</th>
+<th>Meaning</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>
+<code>
+ARRAY<INT64>
+</code>
+</td>
+<td>Simple ARRAY of 64-bit integers.</td>
+</tr>
+<tr>
+<td nowrap="">
+<code>
+ARRAY<STRUCT<INT64, INT64>>
+</code>
+</td>
+<td>An ARRAY of STRUCTs, each of which contains two 64-bit integers.</td>
+</tr>
+<tr>
+<td nowrap="">
+<code>
+ARRAY<ARRAY<INT64>>
+</code><br />
+(not supported)
+</td>
+<td>This is an <strong>invalid</strong> type declaration which is included here
+just in case you came looking for how to create a multi-level ARRAY. ARRAYs
+cannot contain ARRAYs directly. Instead see the next example.</td>
+</tr>
+<tr>
+<td nowrap="">
+<code>
+ARRAY<STRUCT<ARRAY<INT64>>>
+</code>
+</td>
+<td>An ARRAY of ARRAYS of 64-bit integers. Notice that there is a STRUCT between
+the two ARRAYs because ARRAYs cannot hold other ARRAYs directly.</td>
+</tr>
+</tbody></table>
+<h2 id="struct-type">Struct type</h2>
+<table class="table">
+<thead>
+<tr>
+<th>Name</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>STRUCT</code></td>
+<td>Container of ordered fields each with a type (required) and field name
+(optional).</td>
+</tr>
+</tbody>
+</table>
+<h3 id="declaring-a-struct-type">Declaring a STRUCT type</h3>
+<p>STRUCT types are declared using the angle brackets (<code><</code> and <code>></code>). The type of
+the elements of a STRUCT can be arbitrarily complex.</p>
+<h4 id="format_2">Format</h4>
+<pre class="codehilite"><code>STRUCT<T></code></pre>
+<h4 id="examples_3">Examples</h4>
+<table class="table">
+<thead>
+<tr>
+<th>Type Declaration</th>
+<th>Meaning</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>
+<code>
+STRUCT<INT64>
+</code>
+</td>
+<td>Simple STRUCT with a single unnamed 64-bit integer field.</td>
+</tr>
+<tr>
+<td nowrap="">
+<code>
+STRUCT<x STRUCT<y INT64, z INT64>>
+</code>
+</td>
+<td>A STRUCT with a nested STRUCT named <code>x</code> inside it. The STRUCT
+<code>x</code> has two fields, <code>y</code> and <code>z</code>, both of which
+are 64-bit integers.</td>
+</tr>
+<tr>
+<td nowrap="">
+<code>
+STRUCT<inner_array ARRAY<INT64>>
+</code>
+</td>
+<td>A STRUCT containing an ARRAY named <code>inner_array</code> that holds
+64-bit integer elements.</td>
+</tr>
+</tbody></table>
+
+<h3 id="limited-comparisons-for-struct">Limited comparisons for STRUCT</h3>
+<p>STRUCTs can be directly compared using equality operators:</p>
+<ul>
+<li>Equal (<code>=</code>)</li>
+<li>Not Equal (<code>!=</code> or <code><></code>)</li>
+<li>[<code>NOT</code>] <code>IN</code></li>
+</ul>
+<p>Notice, though, that these direct equality comparisons compare the fields of
+the STRUCT pairwise in ordinal order ignoring any field names. If instead you
+want to compare identically named fields of a STRUCT, you can compare the
+individual fields directly.</p>
</div>
</div>
diff --git a/website/generated-content/documentation/dsls/sql/calcite/lexical/index.html b/website/generated-content/documentation/dsls/sql/zetasql/lexical/index.html
similarity index 55%
copy from website/generated-content/documentation/dsls/sql/calcite/lexical/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/lexical/index.html
index 0abe410..15bd92f 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/lexical/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/lexical/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL lexical structure for Calcite</title>
+ <title>Beam ZetaSQL lexical structure</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/calcite/lexical/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/lexical/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/calcite/lexical-structure.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/lexical.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -261,16 +284,13 @@
<ul class="nav">
- <li><a href="#identifiers">Identifiers</a></li>
- <li><a href="#literals">Literals</a>
+ <li><a href="#">2>Identifiers</a></li>
+ <li><a href="#">2>Literals</a>
<ul>
- <li><a href="#string-literals">String Literals</a></li>
+ <li><a href="#string-and-bytes-literals">String and Bytes Literals</a></li>
<li><a href="#integer-literals">Integer Literals</a></li>
<li><a href="#floating-point-literals">Floating Point Literals</a></li>
<li><a href="#array-literals">Array Literals</a></li>
- <li><a href="#struct-literals">Struct Literals</a></li>
- <li><a href="#date-literals">Date Literals</a></li>
- <li><a href="#time-literals">Time Literals</a></li>
<li><a href="#timestamp-literals">Timestamp literals</a></li>
</ul>
</li>
@@ -303,71 +323,81 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-lexical-structure-calcite">Beam SQL lexical structure (Calcite)</h1>
+<h1 id="beam-zetasql-lexical-structure">Beam ZetaSQL lexical structure</h1>
+
+<p>Beam ZetaSQL statements are comprised of a series of tokens. Tokens include
+<em>identifiers,</em> <em>quoted identifiers, literals</em>, <em>keywords</em>, <em>operators</em>, and
+<em>special characters</em>. Tokens can be separated by whitespace (space, backspace,
+tab, newline) or comments.</p>
-<p>A Beam SQL statement comprises a series of tokens. Tokens include
-<em>identifiers,</em> <em>quoted identifiers, literals</em>, <em>keywords</em>, <em>operators</em>,
-and <em>special characters</em>. Tokens can be separated by whitespace (space,
-backspace, tab, newline) or comments. This page documents Beam SQL’s
-lexical structure when using Apache Calcite.</p>
+<p><a id="identifiers"></a></p>
-<h2 id="identifiers">Identifiers</h2>
+<h2>Identifiers</h2>
-<p>Identifiers are names that are associated with columns, tables, and
-other database objects.</p>
+<p>Identifiers are names that are associated with columns, tables, and other
+database objects.</p>
-<p>Identifiers must begin with a letter or an underscore. Subsequent
-characters can be letters, numbers, or underscores. Quoted identifiers
-are identifiers enclosed by backtick (<code class="highlighter-rouge">`</code>) characters and can contain
-any character, such as spaces or symbols. However, quoted identifiers
-cannot be empty. <a href="#reserved-keywords">Reserved Keywords</a> can only be used
-as identifiers if enclosed by backticks.</p>
+<p>There are two ways to specify an identifier: unquoted or quoted:</p>
-<p>Syntax (defined here as a regular expression):</p>
+<ul>
+ <li>Unquoted identifiers must begin with a letter or an underscore.
+ Subsequent characters can be letters, numbers, or underscores.</li>
+ <li>Quoted identifiers are enclosed by backtick (`) characters and can
+ contain any character, such as spaces or symbols. However, quoted identifiers
+ cannot be empty. <a href="#reserved_keywords">Reserved Keywords</a> can only be used as
+ identifiers if enclosed by backticks.</li>
+</ul>
-<p><code class="highlighter-rouge">[A-Za-z_][A-Za-z_0-9]*</code></p>
+<p>Syntax (presented as a grammar with regular expressions, ignoring whitespace):</p>
+
+<pre>
+<span class="var">identifier</span>: { quoted_identifier | unquoted_identifier }
+<span class="var">unquoted_identifier</span>: <code>[A-Za-z_][A-Za-z_0-9]*</code>
+<span class="var">quoted_identifier</span>: <code>\`[^\\\`\r\n]</code> <span class="var">any_escape*</span> <code>\`</code>
+<span class="var">any_escape</span>: <code>\\(. | \n | \r | \r\n)</code>
+</pre>
<p>Examples:</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>Customers5
+<pre class="codehilite"><code>Customers5
_dataField1
-ADGROUP
-</code></pre>
-</div>
+ADGROUP</code></pre>
<p>Invalid examples:</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>5Customers
+<pre class="codehilite"><code>5Customers
_dataField!
-GROUP
-</code></pre>
-</div>
+GROUP</code></pre>
-<p><code class="highlighter-rouge">5Customers</code> begins with a number, not a letter or underscore.
-<code class="highlighter-rouge">_dataField!</code> contains the special character “!” which is not a letter,
-number, or underscore. <code class="highlighter-rouge">GROUP</code> is a reserved keyword, and therefore
-cannot be used as an identifier without being enclosed by backtick
-characters.</p>
+<p><code>5Customers</code> begins with a number, not a letter or underscore. <code>_dataField!</code>
+contains the special character "!" which is not a letter, number, or underscore.
+<code>GROUP</code> is a reserved keyword, and therefore cannot be used as an identifier
+without being enclosed by backtick characters.</p>
<p>Both identifiers and quoted identifiers are case insensitive, with some
-nuances. See <a href="#case-sensitivity">Case Sensitivity</a> for further details.</p>
+nuances. See <a href="#case_sensitivity">Case Sensitivity</a> for further details.</p>
<p>Quoted identifiers have the same escape sequences as string literals,
defined below.</p>
-<h2 id="literals">Literals</h2>
+<p><a id="literals"></a></p>
+
+<h2>Literals</h2>
-<p>A literal represents a constant value of a built-in data type. Some, but
-not all, data types can be expressed as literals.</p>
+<p>A literal represents a constant value of a built-in data type. Some, but not
+all, data types can be expressed as literals.</p>
-<h3 id="string-literals">String Literals</h3>
+<p><a id="string_and_bytes_literals"></a></p>
-<p>Both string and bytes literals must be <em>quoted</em> with single
-(<code class="highlighter-rouge">'</code>) quotation mark.</p>
+<h3 id="string-and-bytes-literals">String and Bytes Literals</h3>
+
+<p>Both string and bytes literals must be <em>quoted</em>, either with single (<code>'</code>) or
+double (<code>"</code>) quotation marks, or <em>triple-quoted</em> with groups of three single
+(<code>'''</code>) or three double (<code>"""</code>) quotation marks.</p>
<p><strong>Quoted literals:</strong></p>
-<table>
+<table class="table">
<thead>
<tr>
<th>Literal</th>
@@ -378,177 +408,243 @@ not all, data types can be expressed as literals.</p>
<tbody>
<tr>
<td>Quoted string</td>
-<td><ul><li><code>'it''s'</code></li><li><code>'Title: "Boy"'</code></li></ul></td>
-<td>Quoted strings enclosed by single (<code>'</code>) quotes can contain unescaped double (<code>"</code>) quotes. <br />Two quotation marks (<code>''</code>) is the escape sequence.<br />Quoted strings can contain newlines.</td>
+<td><ul><li><code>"abc"</code></li><li><code>"it's"</code></li><li><code>'it\'s'</code></li><li><code>'Title: "Boy"'</code></li></ul></td>
+<td>Quoted strings enclosed by single (<code>'</code>) quotes can contain unescaped double (<code>"</code>) quotes, and vice versa. <br />Backslashes (<code>\</code>) introduce escape sequences. See Escape Sequences table below.<br />Quoted strings cannot contain newlines, even when preceded by a backslash (<code>\</code>).</br></br></td>
+</tr>
+<tr>
+<td>Triple-quoted string</td>
+<td><ul><li><code>"""abc"""</code></li><li><code>'''it's'''</code></li><li><code>'''Title:"Boy"'''</code></li><li><code>'''two<br />lines'''</br></code></li><li><code>'''why\?'''</code></li></ul></td>
+<td>Embedded newlines and quotes are allowed without escaping - see fourth example.<br />Backslashes (<code>\</code>) introduce escape sequences. See Escape Sequences table below.<br />A trailing unescaped backslash (<code>\</code>) at the end of a line is not allowed.<br />Three unescaped quotes in a row which match the starting quotes will end the string.</br></br></br></td>
+</tr>
+<tr>
+<td>Raw string</td>
+<td><ul><li><code>R"abc+"</code></li><li> <code>r'''abc+'''</code></li><li> <code>R"""abc+"""</code></li><li><code>r'f\(abc,(.*),def\)'</code></li></ul></td>
+<td>Quoted or triple-quoted literals that have the raw string literal prefix (<code>r</code> or <code>R</code>) are interpreted as raw/regex strings.<br />Backslash characters (<code>\</code>) do not act as escape characters. If a backslash followed by another character occurs inside the string literal, both characters are preserved.<br />A raw string cannot end with an odd number of backslashes.<br />Raw strings are useful for constructing regular expressions.</br></br></ [...]
+</tr>
+</tbody>
+</table>
+
+<p>Prefix characters (<code>r</code>, <code>R</code>, <code>b</code>, <code>B)</code> are optional for quoted or triple-quoted strings, and indicate that the string is a raw/regex string or a byte sequence, respectively. For
+example, <code>b'abc'</code> and <code>b'''abc'''</code> are both interpreted as type bytes. Prefix characters are case insensitive.</p>
+
+<p><strong>Quoted literals with prefixes:</strong></p>
+
+<p>The table below lists all valid escape sequences for representing non-alphanumeric characters in string literals.
+Any sequence not in this table produces an error.</p>
+
+<table class="table">
+<thead>
+<tr>
+<th>Escape Sequence</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>\a</code></td>
+<td>Bell</td>
+</tr>
+<tr>
+<td><code>\b</code></td>
+<td>Backspace</td>
+</tr>
+<tr>
+<td><code>\f</code></td>
+<td>Formfeed</td>
+</tr>
+<tr>
+<td><code>\n</code></td>
+<td>Newline</td>
+</tr>
+<tr>
+<td><code>\r</code></td>
+<td>Carriage Return</td>
+</tr>
+<tr>
+<td><code>\t</code></td>
+<td>Tab</td>
+</tr>
+<tr>
+<td><code>\v</code></td>
+<td>Vertical Tab</td>
+</tr>
+<tr>
+<td><code>\\</code></td>
+<td>Backslash (<code>\</code>)</td>
+</tr>
+<tr>
+<td><code>\?</code></td>
+<td>Question Mark (<code>?</code>)</td>
+</tr>
+<tr>
+<td><code>\"</code></td>
+<td>Double Quote (<code>"</code>)</td>
+</tr>
+<tr>
+<td><code>\'</code></td>
+<td>Single Quote (<code>'</code>)</td>
+</tr>
+<tr>
+<td><code>\`</code></td>
+<td>Backtick (<code>`</code>)</td>
+</tr>
+<tr>
+<td><code>\ooo</code></td>
+<td>Octal escape, with exactly three digits (in the range 0-7). Decodes to a single Unicode character (in string literals).</td>
+</tr>
+<tr>
+<td><code>\xhh</code> or <code>\Xhh</code></td>
+<td>Hex escape, with exactly two hex digits (0-9 or A-F or a-f). Decodes to a single Unicode character (in string literals). Examples:<ul style="list-style-type:none"><li><code>'\x41'</code> == <code>'A'</code></li><li><code>'\x41B'</code> is <code>'AB'</code></li><li><code>'\x4'</code> is an error</li></ul></td>
+</tr>
+<tr>
+<td><code>\uhhhh</code></td>
+<td>Unicode escape, with lowercase 'u' and exactly four hex digits. Valid only in string literals or identifiers.<br />Note that the range D800-DFFF is not allowed, as these are surrogate unicode values.</td>
+</tr>
+<tr>
+<td><code>\Uhhhhhhhh</code></td>
+<td>Unicode escape, with uppercase 'U' and exactly eight hex digits. Valid only in string literals or identifiers.<br />Note that the range D800-DFFF is not allowed, as these are surrogate unicode values. Also, values greater than 10FFFF are not allowed.</td>
</tr>
</tbody>
</table>
+<p><a id="integer_literals"></a></p>
+
<h3 id="integer-literals">Integer Literals</h3>
-<p>Integer literals are either a sequence of decimal digits (0 through 9).
-Integers can be prefixed by “<code class="highlighter-rouge">+</code>” or “<code class="highlighter-rouge">-</code>” to represent positive and
-negative values, respectively.</p>
+<p>Integer literals are either a sequence of decimal digits (0 through
+9) or a hexadecimal value that is prefixed with "<code>0x</code>". Integers can be prefixed
+by "<code>+</code>" or "<code>-</code>" to represent positive and negative values, respectively.</p>
<p>Examples:</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>123
--123
-</code></pre>
-</div>
+<pre class="codehilite"><code>123
+0xABC
+-123</code></pre>
-<p>An integer literal is interpreted as an <code class="highlighter-rouge">BIGINT</code>.</p>
+<p>An integer literal is interpreted as an <code>INT64</code>.</p>
+
+<p><a id="floating_point_literals"></a></p>
<h3 id="floating-point-literals">Floating Point Literals</h3>
<p>Syntax options:</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>[+-]DIGITS.[DIGITS][e[+-]DIGITS]
+<pre class="codehilite"><code>[+-]DIGITS.[DIGITS][e[+-]DIGITS]
[DIGITS].DIGITS[e[+-]DIGITS]
-DIGITSe[+-]DIGITS
-</code></pre>
-</div>
+DIGITSe[+-]DIGITS</code></pre>
-<p><code class="highlighter-rouge">DIGITS</code> represents one or more decimal numbers (0 through 9) and <code class="highlighter-rouge">e</code>
-represents the exponent marker (e or E).</p>
+<p><code>DIGITS</code> represents one or more decimal numbers (0 through 9) and <code>e</code> represents the exponent marker (e or E).</p>
<p>Examples:</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>123.456e-67
+<pre class="codehilite"><code>123.456e-67
.1E4
58.
-4e2
-</code></pre>
-</div>
+4e2</code></pre>
+
+<p>Numeric literals that contain
+either a decimal point or an exponent marker are presumed to be type double.</p>
-<p>Numeric literals that contain either a decimal point or an exponent
-marker are presumed to be type double.</p>
+<p>Implicit coercion of floating point literals to float type is possible if the
+value is within the valid float range.</p>
-<p>Implicit coercion of floating point literals to float type is possible
-if the value is within the valid float range.</p>
+<p>There is no literal
+representation of NaN or infinity.</p>
-<p>There is no literal representation of NaN or infinity.</p>
+<p><a id="array_literals"></a></p>
<h3 id="array-literals">Array Literals</h3>
-<p>Array literals are a comma-separated lists of elements enclosed in
-square brackets prefixed with the <code class="highlighter-rouge">ARRAY</code> keyword.</p>
+<p>Array literals are a comma-separated lists of elements
+enclosed in square brackets. The <code>ARRAY</code> keyword is optional, and an explicit
+element type T is also optional.</p>
<p>Examples:</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>ARRAY[1, 2, 3]
-ARRAY['x', 'y', 'xy']
+<pre class="codehilite"><code>[1, 2, 3]
+['x', 'y', 'xy']
+ARRAY[1, 2, 3]
+ARRAY<string>['x', 'y', 'xy']
</code></pre>
-</div>
-<h3 id="struct-literals">Struct Literals</h3>
+<h3 id="timestamp-literals">Timestamp literals</h3>
<p>Syntax:</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>(elem[, elem...])
-</code></pre>
-</div>
+<pre class="codehilite"><code>TIMESTAMP 'YYYY-[M]M-[D]D [[H]H:[M]M:[S]S[.DDDDDD]] [timezone]'</code></pre>
-<p>where <code class="highlighter-rouge">elem</code> is an element in the struct. <code class="highlighter-rouge">elem</code> must be a literal data
-type, not an expression or column name.</p>
+<p>Timestamp literals contain the <code>TIMESTAMP</code> keyword and a string literal that
+conforms to the canonical timestamp format, enclosed in single quotation marks.</p>
-<p>The output type is an anonymous struct type (structs are not named
-types) with anonymous fields with types matching the types of the input
-expressions.</p>
+<p>Timestamp literals support a range between the years 1 and 9999, inclusive.
+Timestamps outside of this range are invalid.</p>
-<table>
-<thead>
-<tr>
-<th>Example</th>
-<th>Output Type</th>
-</tr>
-</thead>
-<tbody>
-<tr>
-<td><code>(1, 2, 3)</code></td>
-<td><code>STRUCT<BIGINT,BIGINT,BIGINT></code></td>
-</tr>
-<tr>
-<td><code>(1, 'abc')</code></td>
-<td><code>STRUCT<BIGINT,STRING></code></td>
-</tr>
-</tbody>
-</table>
+<p>A timestamp literal can include a numerical suffix to indicate the timezone:</p>
-<h3 id="date-literals">Date Literals</h3>
+<pre class="codehilite"><code>TIMESTAMP '2014-09-27 12:30:00.45-08'</code></pre>
-<p>Syntax:</p>
+<p>If this suffix is absent, the default timezone, UTC, is used.</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>DATE 'YYYY-M[M]-D[D]'
-</code></pre>
-</div>
+<p>For example, the following timestamp represents 12:30 p.m. on September 27,
+2014, using the timezone, UTC:</p>
-<p>Date literals contain the <code class="highlighter-rouge">DATE</code> keyword followed by a string literal
-that conforms to the canonical date format, enclosed in single quotation
-marks. Date literals support a range between the years 1 and 9999,
-inclusive. Dates outside of this range are invalid.</p>
+<pre class="codehilite"><code>TIMESTAMP '2014-09-27 12:30:00.45'</code></pre>
-<p>For example, the following date literal represents September 27, 2014:</p>
+<p>For more information on timezones, see <a href="#timezone">Timezone</a>.</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>DATE '2014-09-27'
-</code></pre>
-</div>
+<p>String literals with the canonical timestamp format, including those with
+timezone names, implicitly coerce to a timestamp literal when used where a
+timestamp expression is expected. For example, in the following query, the
+string literal <code>"2014-09-27 12:30:00.45 America/Los_Angeles"</code> is coerced
+to a timestamp literal.</p>
-<p>String literals in canonical date format also implicitly coerce to DATE
-type when used where a DATE-type expression is expected. For example, in
-the query</p>
+<pre class="codehilite"><code>SELECT * FROM foo
+WHERE timestamp_col = "2014-09-27 12:30:00.45 America/Los_Angeles"</code></pre>
-<div class="highlighter-rouge"><pre class="highlight"><code>SELECT * FROM foo WHERE date_col = "2014-09-27"
-</code></pre>
-</div>
-
-<p>the string literal <code class="highlighter-rouge">"2014-09-27"</code> will be coerced to a date literal.</p>
+<h4 id="timezone">Timezone</h4>
-<h3 id="time-literals">Time Literals</h3>
+<p>Since timestamp literals must be mapped to a specific point in time, a timezone
+is necessary to correctly interpret a literal. If a timezone is not specified
+as part of the literal itself, then the default timezone value, which is set by
+the Beam SQL implementation, is used.</p>
-<p>Syntax:</p>
+<p>Timezones are represented by strings in the following canonical format, which
+represents the offset from Coordinated Universal Time (UTC).</p>
-<div class="highlighter-rouge"><pre class="highlight"><code>TIME '[H]H:[M]M:[S]S[.DDDDDD]]'
-</code></pre>
-</div>
+<p>Format:</p>
-<p>TIME literals contain the <code class="highlighter-rouge">TIME</code> keyword and a string literal that
-conforms to the canonical time format, enclosed in single quotation
-marks.</p>
-
-<p>For example, the following time represents 12:30 p.m.:</p>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>TIME '12:30:00.45'
-</code></pre>
-</div>
+<pre class="codehilite"><code>(+|-)H[H][:M[M]]</code></pre>
-<h3 id="timestamp-literals">Timestamp literals</h3>
+<p>Examples:</p>
-<p>Syntax:</p>
+<pre class="codehilite"><code>'-08:00'
+'-8:15'
+'+3:00'
+'+07:30'
+'-7'</code></pre>
-<div class="highlighter-rouge"><pre class="highlight"><code>TIMESTAMP 'YYYY-[M]M-[D]D [[H]H:[M]M:[S]S[.DDDDDD]]'
-</code></pre>
-</div>
+<p>Timezones can also be expressed using string timezone names from the
+<a href="http://www.iana.org/time-zones">tz database</a>. For a less comprehensive but
+simpler reference, see the
+<a href="http://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database timezones</a>
+on Wikipedia. Canonical timezone names have the format
+<code><continent/[region/]city></code>, such as <code>America/Los_Angeles</code>.</p>
-<p>Timestamp literals contain the <code class="highlighter-rouge">TIMESTAMP</code> keyword and a string literal
-that conforms to the canonical timestamp format, enclosed in single
-quotation marks.</p>
+<p>Note that not all timezone names are interchangeable even if they do happen to
+report the same time during a given part of the year. For example, <code>America/Los_Angeles</code> reports the same time as <code>UTC-7:00</code> during Daylight Savings Time, but reports the same time as <code>UTC-8:00</code> outside of Daylight Savings Time.</p>
-<p>Timestamp literals support a range between the years 1 and 9999,
-inclusive. Timestamps outside of this range are invalid.</p>
+<p>Example:</p>
-<p>For example, the following timestamp represents 12:30 p.m. on September
-27, 2014:</p>
+<pre class="codehilite"><code>TIMESTAMP '2014-09-27 12:30:00 America/Los_Angeles'
+TIMESTAMP '2014-09-27 12:30:00 America/Argentina/Buenos_Aires'</code></pre>
-<div class="highlighter-rouge"><pre class="highlight"><code>TIMESTAMP '2014-09-27 12:30:00.45'
-</code></pre>
-</div>
+<p><a id="case_sensitivity"></a></p>
<h2 id="case-sensitivity">Case Sensitivity</h2>
<p>Beam SQL follows these rules for case sensitivity:</p>
-<table>
+<table class="table">
<thead>
<tr>
<th>Category</th>
@@ -560,22 +656,22 @@ inclusive. Timestamps outside of this range are invalid.</p>
<tr>
<td>Keywords</td>
<td>No</td>
-<td></td>
+<td> </td>
</tr>
<tr>
<td>Function names</td>
<td>No</td>
-<td></td>
+<td> </td>
</tr>
<tr>
<td>Table names</td>
-<td>Yes</td>
-<td></td>
+<td>See Notes</td>
+<td>Table names are usually case insensitive, but may be case sensitive when querying a database that uses case sensitive table names.</td>
</tr>
<tr>
<td>Column names</td>
-<td>Yes</td>
-<td></td>
+<td>No</td>
+<td> </td>
</tr>
<tr>
<td>String values</td>
@@ -585,12 +681,12 @@ inclusive. Timestamps outside of this range are invalid.</p>
<tr>
<td>String comparisons</td>
<td>Yes</td>
-<td></td>
+<td> </td>
</tr>
<tr>
<td>Aliases within a query</td>
<td>No</td>
-<td></td>
+<td> </td>
</tr>
<tr>
<td>Regular expression matching</td>
@@ -600,736 +696,182 @@ inclusive. Timestamps outside of this range are invalid.</p>
<tr>
<td><code>LIKE</code> matching</td>
<td>Yes</td>
-<td> </td>
+<td> </td>
</tr>
</tbody>
</table>
+<p><a id="reserved_keywords"></a></p>
+
<h2 id="reserved-keywords">Reserved Keywords</h2>
<p>Keywords are a group of tokens that have special meaning in the Beam SQL
-language, and have the following characteristics:</p>
+language, and have the following characteristics:</p>
<ul>
- <li>Keywords cannot be used as identifiers unless enclosed by backtick
-(`) characters.</li>
- <li>Keywords are case insensitive.</li>
+<li>Keywords cannot be used as identifiers unless enclosed by backtick (`) characters.</li>
+<li>Keywords are case insensitive.</li>
</ul>
<p>Beam SQL has the following reserved keywords.</p>
-<table style="table-layout: fixed; width: 110%">
+<table style="table-layout: fixed; width: 110%" class="table">
<tbody>
<tr>
<td>
-A<br />
-ABS<br />
-ABSOLUTE<br />
-ACTION<br />
-ADA<br />
-ADD<br />
-ADMIN<br />
-AFTER<br />
ALL<br />
-ALLOCATE<br />
-ALLOW<br />
-ALTER<br />
-ALWAYS<br />
AND<br />
ANY<br />
-APPLY<br />
-ARE<br />
ARRAY<br />
-ARRAY_MAX_CARDINALITY<br />
AS<br />
ASC<br />
-ASENSITIVE<br />
-ASSERTION<br />
-ASSIGNMENT<br />
-ASYMMETRIC<br />
+ASSERT_ROWS_MODIFIED<br />
AT<br />
-ATOMIC<br />
-ATTRIBUTE<br />
-ATTRIBUTES<br />
-AUTHORIZATION<br />
-AVG<br />
-BEFORE<br />
-BEGIN<br />
-BEGIN_FRAME<br />
-BEGIN_PARTITION<br />
-BERNOULLI<br />
BETWEEN<br />
-BIGINT<br />
-BINARY<br />
-BIT<br />
-BLOB<br />
-BOOLEAN<br />
-BOTH<br />
-BREADTH<br />
BY<br />
-C<br />
-CALL<br />
-CALLED<br />
-CARDINALITY<br />
-CASCADE<br />
-CASCADED<br />
CASE<br />
CAST<br />
-CATALOG<br />
-CATALOG_NAME<br />
-CEIL<br />
-CEILING<br />
-CENTURY<br />
-CHAIN<br />
-CHAR<br />
-CHAR_LENGTH<br />
-CHARACTER<br />
-CHARACTER_LENGTH<br />
-CHARACTER_SET_CATALOG<br />
-CHARACTER_SET_NAME<br />
-CHARACTER_SET_SCHEMA<br />
-CHARACTERISTICS<br />
-CHARACTERS<br />
-CHECK<br />
-CLASSIFIER<br />
-CLASS_ORIGIN<br />
-CLOB<br />
-CLOSE<br />
-COALESCE<br />
-COBOL<br />
COLLATE<br />
-COLLATION<br />
-COLLATION_CATALOG<br />
-COLLATION_NAME<br />
-COLLATION_SCHEMA<br />
-COLLECT<br />
-COLUMN<br />
-COLUMN_NAME<br />
-COMMAND_FUNCTION<br />
-COMMAND_FUNCTION_CODE<br />
-COMMENT<br />
-COMMIT<br />
-COMMITTED<br />
-CONDITION<br />
-CONDITION_NUMBER<br />
-CONNECT<br />
-CONNECTION<br />
-CONNECTION_NAME<br />
-CONSTRAINT<br />
-CONSTRAINT_CATALOG<br />
-CONSTRAINT_NAME<br />
-CONSTRAINT_SCHEMA<br />
-CONSTRAINTS<br />
-CONSTRUCTOR<br />
CONTAINS<br />
-CONTINUE<br />
-CONVERT<br />
-CORR<br />
-CORRESPONDING<br />
-COUNT<br />
-COVAR_POP<br />
-COVAR_SAMP<br />
CREATE<br />
CROSS<br />
CUBE<br />
-CUME_DIST<br />
CURRENT<br />
-CURRENT_CATALOG<br />
-CURRENT_DATE<br />
-CURRENT_DEFAULT_TRANSFORM_GROUP<br />
-CURRENT_PATH<br />
-CURRENT_ROLE<br />
-CURRENT_ROW<br />
-CURRENT_SCHEMA<br />
-CURRENT_TIME<br />
-CURRENT_TIMESTAMP<br />
-CURRENT_TRANSFORM_GROUP_FOR_TYPE<br />
-CURRENT_USER<br />
-CURSOR<br />
-CURSOR_NAME<br />
-CYCLE<br />
-DATA<br />
-DATABASE<br />
-DATE<br />
-DATETIME_INTERVAL_CODE<br />
-DATETIME_INTERVAL_PRECISION<br />
-DAY<br />
-DEALLOCATE<br />
-DEC<br />
-DECADE<br />
-DECIMAL<br />
-DECLARE<br />
DEFAULT<br />
-DEFAULTS<br />
-DEFERRABLE<br />
-DEFERRED<br />
DEFINE<br />
-DEFINED<br />
-DEFINER<br />
-DEGREE<br />
-DELETE<br />
-DENSE_RANK<br />
-DEPTH<br />
-DEREF<br />
-DERIVED<br />
DESC<br />
-DESCRIBE<br />
-DESCRIPTION<br />
-DESCRIPTOR<br />
-DETERMINISTIC<br />
-DIAGNOSTICS<br />
-DISALLOW<br />
-DISCONNECT<br />
-DISPATCH<br />
DISTINCT<br />
-DOMAIN<br />
-DOUBLE<br />
-DOW<br />
-DOY<br />
-DROP<br />
-DYNAMIC<br />
-DYNAMIC_FUNCTION<br />
-DYNAMIC_FUNCTION_CODE<br />
-EACH<br />
-ELEMENT<br />
ELSE<br />
-EMPTY<br />
END<br />
-END-EXEC<br />
-END_FRAME<br />
-END_PARTITION<br />
-EPOCH<br />
-EQUALS<br />
+</td>
+<td>
+ENUM<br />
ESCAPE<br />
-EVERY<br />
EXCEPT<br />
-EXCEPTION<br />
EXCLUDE<br />
-EXCLUDING<br />
-EXEC<br />
-EXECUTE<br />
EXISTS<br />
-EXP<br />
-EXPLAIN<br />
-EXTEND<br />
-EXTERNAL<br />
EXTRACT<br />
FALSE<br />
FETCH<br />
-FILTER<br />
-FINAL<br />
-FIRST<br />
-FIRST_VALUE<br />
-FLOAT<br />
-FLOOR<br />
FOLLOWING<br />
FOR<br />
-FOREIGN<br />
-FORTRAN<br />
-FOUND<br />
-FRAC_SECOND<br />
-FRAME_ROW<br />
-FREE<br />
FROM<br />
FULL<br />
-FUNCTION<br />
-FUSION<br />
-G<br />
-GENERAL<br />
-GENERATED<br />
-GEOMETRY<br />
-GET<br />
-GLOBAL<br />
-GO<br />
-GOTO<br />
-GRANT<br />
-GRANTED<br />
GROUP<br />
GROUPING<br />
GROUPS<br />
+HASH<br />
HAVING<br />
-HIERARCHY<br />
-HOLD<br />
-HOUR<br />
-IDENTITY<br />
IF<br />
-IMMEDIATE<br />
-IMMEDIATELY<br />
-IMPLEMENTATION<br />
-IMPORT<br />
+IGNORE<br />
IN<br />
-INCLUDING<br />
-INCREMENT<br />
-INDICATOR<br />
-INITIAL<br />
-INITIALLY<br />
INNER<br />
-INOUT<br />
-INPUT<br />
-INSENSITIVE<br />
-INSERT<br />
-INSTANCE<br />
-INSTANTIABLE<br />
-INT<br />
-INTEGER<br />
INTERSECT<br />
-INTERSECTION<br />
INTERVAL<br />
INTO<br />
-INVOKER<br />
+</td>
+<td>
IS<br />
-ISOLATION<br />
-JAVA<br />
JOIN<br />
-JSON<br />
-K<br />
-KEY<br />
-KEY_MEMBER<br />
-KEY_TYPE<br />
-LABEL<br />
-LAG<br />
-LANGUAGE<br />
-LARGE<br />
-LAST<br />
-LAST_VALUE<br />
LATERAL<br />
-LEAD<br />
-LEADING<br />
LEFT<br />
-LENGTH<br />
-LEVEL<br />
-LIBRARY<br />
LIKE<br />
-LIKE_REGEX<br />
LIMIT<br />
-LN<br />
-LOCAL<br />
-LOCALTIME<br />
-LOCALTIMESTAMP<br />
-LOCATION<br />
-LOCATOR<br />
-LOWER<br />
-M<br />
-MAP<br />
-MATCH<br />
-MATCHED<br />
-MATCHES<br />
-MATCH_NUMBER<br />
-MATCH_RECOGNIZE<br />
-MAX<br />
-MAXVALUE<br />
-MEASURES<br />
-MEMBER<br />
+LOOKUP<br />
MERGE<br />
-MESSAGE_LENGTH<br />
-MESSAGE_OCTET_LENGTH<br />
-MESSAGE_TEXT<br />
-METHOD<br />
-MICROSECOND<br />
-MILLENNIUM<br />
-MIN<br />
-MINUTE<br />
-MINVALUE<br />
-MOD<br />
-MODIFIES<br />
-MODULE<br />
-MONTH<br />
-MORE<br />
-MULTISET<br />
-MUMPS<br />
-NAME<br />
-NAMES<br />
-NATIONAL<br />
NATURAL<br />
-NCHAR<br />
-NCLOB<br />
-NESTING<br />
-</td>
-<td>
NEW<br />
-NEXT<br />
NO<br />
-NONE<br />
-NORMALIZE<br />
-NORMALIZED<br />
NOT<br />
-NTH_VALUE<br />
-NTILE<br />
NULL<br />
-NULLABLE<br />
-NULLIF<br />
NULLS<br />
-NUMBER<br />
-NUMERIC<br />
-OBJECT<br />
-OCCURRENCES_REGEX<br />
-OCTET_LENGTH<br />
-OCTETS<br />
OF<br />
-OFFSET<br />
-OLD<br />
-OMIT<br />
ON<br />
-ONE<br />
-ONLY<br />
-OPEN<br />
-OPTION<br />
-OPTIONS<br />
OR<br />
ORDER<br />
-ORDERING<br />
-ORDINALITY<br />
-OTHERS<br />
-OUT<br />
OUTER<br />
-OUTPUT<br />
OVER<br />
-OVERLAPS<br />
-OVERLAY<br />
-OVERRIDING<br />
-PAD<br />
-PARAMETER<br />
-PARAMETER_MODE<br />
-PARAMETER_NAME<br />
-PARAMETER_ORDINAL_POSITION<br />
-PARAMETER_SPECIFIC_CATALOG<br />
-PARAMETER_SPECIFIC_NAME<br />
-PARAMETER_SPECIFIC_SCHEMA<br />
-PARTIAL<br />
PARTITION<br />
-PASCAL<br />
-PASSTHROUGH<br />
-PAST<br />
-PATH<br />
-PATTERN<br />
-PER<br />
-PERCENT<br />
-PERCENTILE_CONT<br />
-PERCENTILE_DISC<br />
-PERCENT_RANK<br />
-PERIOD<br />
-PERMUTE<br />
-PLACING<br />
-PLAN<br />
-PLI<br />
-PORTION<br />
-POSITION<br />
-POSITION_REGEX<br />
-POWER<br />
-PRECEDES<br />
PRECEDING<br />
-PRECISION<br />
-PREPARE<br />
-PRESERVE<br />
-PREV<br />
-PRIMARY<br />
-PRIOR<br />
-PRIVILEGES<br />
-PROCEDURE<br />
-PUBLIC<br />
-QUARTER<br />
+PROTO<br />
RANGE<br />
-RANK<br />
-READ<br />
-READS<br />
-REAL<br />
+</td>
+<td>
RECURSIVE<br />
-REF<br />
-REFERENCES<br />
-REFERENCING<br />
-REGR_AVGX<br />
-REGR_AVGY<br />
-REGR_COUNT<br />
-REGR_INTERCEPT<br />
-REGR_R2<br />
-REGR_SLOPE<br />
-REGR_SXX<br />
-REGR_SXY<br />
-REGR_SYY<br />
-RELATIVE<br />
-RELEASE<br />
-REPEATABLE<br />
-REPLACE<br />
-RESET<br />
-RESTART<br />
-RESTRICT<br />
-RESULT<br />
-RETURN<br />
-RETURNED_CARDINALITY<br />
-RETURNED_LENGTH<br />
-RETURNED_OCTET_LENGTH<br />
-RETURNED_SQLSTATE<br />
-RETURNS<br />
-REVOKE<br />
+RESPECT<br />
RIGHT<br />
-ROLE<br />
-ROLLBACK<br />
ROLLUP<br />
-ROUTINE<br />
-ROUTINE_CATALOG<br />
-ROUTINE_NAME<br />
-ROUTINE_SCHEMA<br />
-ROW<br />
-ROW_COUNT<br />
-ROW_NUMBER<br />
ROWS<br />
-RUNNING<br />
-SAVEPOINT<br />
-SCALE<br />
-SCHEMA<br />
-SCHEMA_NAME<br />
-SCOPE<br />
-SCOPE_CATALOGS<br />
-SCOPE_NAME<br />
-SCOPE_SCHEMA<br />
-SCROLL<br />
-SEARCH<br />
-SECOND<br />
-SECTION<br />
-SECURITY<br />
-SEEK<br />
SELECT<br />
-SELF<br />
-SENSITIVE<br />
-SEQUENCE<br />
-SERIALIZABLE<br />
-SERVER<br />
-SERVER_NAME<br />
-SESSION<br />
-SESSION_USER<br />
SET<br />
-SETS<br />
-MINUS<br />
-SHOW<br />
-SIMILAR<br />
-SIMPLE<br />
-SIZE<br />
-SKIP<br />
-SMALLINT<br />
SOME<br />
-SOURCE<br />
-SPACE<br />
-SPECIFIC<br />
-SPECIFIC_NAME<br />
-SPECIFICTYPE<br />
-SQL<br />
-SQLEXCEPTION<br />
-SQLSTATE<br />
-SQLWARNING<br />
-SQL_BIGINT<br />
-SQL_BINARY<br />
-SQL_BIT<br />
-SQL_BLOB<br />
-SQL_BOOLEAN<br />
-SQL_CHAR<br />
-SQL_CLOB<br />
-SQL_DATE<br />
-SQL_DECIMAL<br />
-SQL_DOUBLE<br />
-SQL_FLOAT<br />
-SQL_INTEGER<br />
-SQL_INTERVAL_DAY<br />
-SQL_INTERVAL_DAY_TO_HOUR<br />
-SQL_INTERVAL_DAY_TO_MINUTE<br />
-SQL_INTERVAL_DAY_TO_SECOND<br />
-SQL_INTERVAL_HOUR<br />
-SQL_INTERVAL_HOUR_TO_MINUTE<br />
-SQL_INTERVAL_HOUR_TO_SECOND<br />
-SQL_INTERVAL_MINUTE<br />
-SQL_INTERVAL_MINUTE_TO_SECOND<br />
-SQL_INTERVAL_MONTH<br />
-SQL_INTERVAL_SECOND<br />
-SQL_INTERVAL_YEAR<br />
-SQL_INTERVAL_YEAR_TO_MONTH<br />
-SQL_LONGVARBINARY<br />
-SQL_LONGVARCHAR<br />
-SQL_LONGVARNCHAR<br />
-SQL_NCHAR<br />
-SQL_NCLOB<br />
-SQL_NUMERIC<br />
-SQL_NVARCHAR<br />
-SQL_REAL<br />
-SQL_SMALLINT<br />
-SQL_TIME<br />
-SQL_TIMESTAMP<br />
-SQL_TINYINT<br />
-SQL_TSI_DAY<br />
-SQL_TSI_FRAC_SECOND<br />
-SQL_TSI_HOUR<br />
-SQL_TSI_MICROSECOND<br />
-SQL_TSI_MINUTE<br />
-SQL_TSI_MONTH<br />
-SQL_TSI_QUARTER<br />
-SQL_TSI_SECOND<br />
-SQL_TSI_WEEK<br />
-SQL_TSI_YEAR<br />
-SQL_VARBINARY<br />
-SQL_VARCHAR<br />
-SQRT<br />
-START<br />
-STATE<br />
-STATEMENT<br />
-STATIC<br />
-STDDEV_POP<br />
-STDDEV_SAMP<br />
-STREAM<br />
-STRUCTURE<br />
-STYLE<br />
-SUBCLASS_ORIGIN<br />
-SUBMULTISET<br />
-SUBSET<br />
-SUBSTITUTE<br />
-SUBSTRING<br />
-SUBSTRING_REGEX<br />
-SUCCEEDS<br />
-SUM<br />
-SYMMETRIC<br />
-SYSTEM<br />
-SYSTEM_TIME<br />
-SYSTEM_USER<br />
-TABLE<br />
-TABLE_NAME<br />
+STRUCT<br />
TABLESAMPLE<br />
-TBLPROPERTIES<br />
-TEMPORARY<br />
THEN<br />
-TIES<br />
-TIME<br />
-TIMESTAMP<br />
-TIMESTAMPADD<br />
-TIMESTAMPDIFF<br />
-TIMEZONE_HOUR<br />
-TIMEZONE_MINUTE<br />
-TINYINT<br />
TO<br />
-TOP_LEVEL_COUNT<br />
-TRAILING<br />
-TRANSACTION<br />
-TRANSACTIONS_ACTIVE<br />
-TRANSACTIONS_COMMITTED<br />
-TRANSACTIONS_ROLLED_BACK<br />
-TRANSFORM<br />
-TRANSFORMS<br />
-TRANSLATE<br />
-TRANSLATE_REGEX<br />
-TRANSLATION<br />
TREAT<br />
-TRIGGER<br />
-TRIGGER_CATALOG<br />
-TRIGGER_NAME<br />
-TRIGGER_SCHEMA<br />
-TRIM<br />
-TRIM_ARRAY<br />
TRUE<br />
-TRUNCATE<br />
-TYPE<br />
-UESCAPE<br />
UNBOUNDED<br />
-UNCOMMITTED<br />
-UNDER<br />
UNION<br />
-UNIQUE<br />
-UNKNOWN<br />
-UNNAMED<br />
UNNEST<br />
-UPDATE<br />
-UPPER<br />
-UPSERT<br />
-USAGE<br />
-USER<br />
-USER_DEFINED_TYPE_CATALOG<br />
-USER_DEFINED_TYPE_CODE<br />
-USER_DEFINED_TYPE_NAME<br />
-USER_DEFINED_TYPE_SCHEMA<br />
USING<br />
-VALUE<br />
-VALUES<br />
-VALUE_OF<br />
-VAR_POP<br />
-VAR_SAMP<br />
-VARBINARY<br />
-VARCHAR<br />
-VARYING<br />
-VERSION<br />
-VERSIONING<br />
-VIEW<br />
-WEEK<br />
WHEN<br />
-WHENEVER<br />
WHERE<br />
-WIDTH_BUCKET<br />
WINDOW<br />
WITH<br />
WITHIN<br />
-WITHOUT<br />
-WORK<br />
-WRAPPER<br />
-WRITE<br />
-XML<br />
-YEAR<br />
-ZONE<br />
</td>
</tr>
</tbody>
</table>
+<p><a id="terminating_semicolons"></a></p>
+
<h2 id="terminating-semicolons">Terminating Semicolons</h2>
-<p>Statements can optionally use a terminating semicolon (<code class="highlighter-rouge">;</code>) in the
-context of a query string submitted through an Application Programming
-Interface (API). Some interactive tools require statements to have a
-terminating semicolon. In a request containing multiple statements,
-statements must be separated by semicolons, but the semicolon is
-optional for the final statement.</p>
+<p>Statements can optionally use a terminating semicolon (<code>;</code>) in the context of a query string submitted through an Application Programming Interface (API). Some interactive tools require statements to have a terminating semicolon.
+In a request containing multiple statements, statements must be separated by semicolons, but the semicolon is optional for the final statement.</p>
<h2 id="comments">Comments</h2>
-<p>Comments are sequences of characters that are ignored by the parser.
-Beam SQL supports the following types of comments.</p>
+<p>Comments are sequences of characters that are ignored by the parser. Beam SQL
+supports the following types of comments.</p>
<h3 id="single-line-comments">Single line comments</h3>
-<p>Single line comments are supported by prepending <code class="highlighter-rouge">--</code> before the comment.</p>
+<p>Single line comments are supported by prepending <code>#</code> or <code>--</code> before the
+comment.</p>
<p><strong>Examples</strong></p>
-<p><code class="highlighter-rouge">SELECT x FROM T; --x is a field and T is a table</code></p>
+<p><code>SELECT x FROM T; # x is a field and T is a table</code></p>
+
+<p>Comment includes all characters from the '#' character to the end of the line.</p>
+
+<p><code>SELECT x FROM T; --x is a field and T is a table</code></p>
-<p>Comment includes all characters from the ‘<code class="highlighter-rouge">--</code>’ sequence to the end of
-the line. You can optionally add a space after the ‘<code class="highlighter-rouge">--</code>’.</p>
+<p>Comment includes all characters from the '<code>--</code>' sequence to the end of the line. You can optionally add a space after the '<code>--</code>'.</p>
<h3 id="multiline-comments">Multiline comments</h3>
-<p>Multiline comments are supported by enclosing the comment using
-<code class="highlighter-rouge">/* <comment> */</code>.</p>
+<p>Multiline comments are supported by enclosing the comment using <code>/* <comment> */</code>.</p>
<p><strong>Example:</strong></p>
-<div class="highlighter-rouge"><pre class="highlight"><code>SELECT x FROM T /* x is a field and T is a table */
-WHERE x = 3;
-</code></pre>
-</div>
+<pre class="codehilite"><code>SELECT x FROM T /* x is a field and T is a table */
+WHERE x = 3;</code></pre>
<p><strong>Invalid example:</strong></p>
-<div class="highlighter-rouge"><pre class="highlight"><code>SELECT x FROM T /* comment starts here
+<pre class="codehilite"><code>SELECT x FROM T /* comment starts here
/* comment ends on this line */
this line is not considered a comment */
-WHERE x = 3;
-</code></pre>
-</div>
-
-<p>Comment includes all characters, including newlines, enclosed by the
-first occurrence of ‘<code class="highlighter-rouge">/*</code>’ and the first subsequent occurrence of
-‘<code class="highlighter-rouge">*/</code>’. Nested comments are not supported. The second example contains a
-nested comment that renders the query invalid.</p>
-
-<blockquote>
- <p>Portions of this page are modifications based on work created and
-<a href="https://developers.google.com/terms/site-policies">shared by Google</a>
-and used according to terms described in the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons 3.0
-Attribution License</a>.</p>
-</blockquote>
+WHERE x = 3;</code></pre>
+
+<p>Comment includes all characters, including newlines, enclosed by the first
+occurrence of '<code>/*</code>' and the first subsequent occurrence of '<code>*/</code>'. Nested
+comments are not supported. The second example contains a nested comment that
+renders the query invalid.</p>
</div>
</div>
diff --git a/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html b/website/generated-content/documentation/dsls/sql/zetasql/math-functions/index.html
similarity index 80%
copy from website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/math-functions/index.html
index cba0743..f065d5b 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/aggregate-functions/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/math-functions/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL aggregate functions for Calcite</title>
+ <title>Beam ZetaSQL mathematical functions</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/calcite/aggregate-functions/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/math-functions/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/calcite/aggregate-functions.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/math-functions.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -260,6 +283,16 @@
+<ul class="nav">
+ <li><a href="#mod">MOD</a></li>
+ <li><a href="#ceil">CEIL</a></li>
+ <li><a href="#ceiling">CEILING</a></li>
+ <li><a href="#floor">FLOOR</a>
+ <ul>
+ <li><a href="#example-rounding-function-behavior">Example rounding function behavior</a></li>
+ </ul>
+ </li>
+</ul>
</nav>
@@ -279,13 +312,11 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-aggregate-functions-calcite">Beam SQL aggregate functions (Calcite)</h1>
+<h1 id="beam-zetasql-mathematical-functions">Beam ZetaSQL mathematical functions</h1>
-<p>This page documents built-in functions supported by Beam SQL when using Apache Calcite.</p>
+<p>This page documents ZetaSQL scalar functions supported by Beam ZetaSQL.</p>
-<p>See also <a href="http://calcite.apache.org/docs/reference.html#operators-and-functions">Calcite
-SQL’s operators and functions
-reference</a>.</p>
+<p>All mathematical functions return <code class="highlighter-rouge">NULL</code> if any of the input parameters is <code class="highlighter-rouge">NULL</code>.</p>
<table class="table">
<thead>
@@ -296,28 +327,122 @@ reference</a>.</p>
</thead>
<tbody>
<tr>
- <td>COUNT(*)</td>
- <td>Returns the number of input rows</td>
+ <td>MOD(X, Y)</td>
+ <td>Returns the remainder of the division of X by Y</td>
</tr>
<tr>
- <td>AVG(numeric)</td>
- <td>Returns the average (arithmetic mean) of numeric across all input values</td>
+ <td>CEIL(X)</td>
+ <td>Returns the smallest integral value (with FLOAT64 type) that is not less than X</td>
</tr>
<tr>
- <td>SUM(numeric)</td>
- <td>Returns the sum of numeric across all input values</td>
+ <td>CEILING(X)</td>
+ <td>Synonym of CEIL(X)</td>
</tr>
<tr>
- <td>MAX(value)</td>
- <td>Returns the maximum value of value across all input values</td>
- </tr>
- <tr>
- <td>MIN(value)</td>
- <td>Returns the minimum value of value across all input values</td>
+ <td>FLOOR(X)</td>
+ <td>Returns the largest integral value (with FLOAT64 type) that is not greater than X</td>
</tr>
</tbody>
</table>
+<h2 id="mod">MOD</h2>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>MOD(X, Y)
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Modulo function: returns the remainder of the division of X by Y. Returned value
+has the same sign as X.</p>
+
+<h2 id="ceil">CEIL</h2>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>CEIL(X)
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Returns the smallest integral value (with FLOAT64
+type) that is not less than X.</p>
+
+<h2 id="ceiling">CEILING</h2>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>CEILING(X)
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Synonym of CEIL(X)</p>
+
+<h2 id="floor">FLOOR</h2>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>FLOOR(X)
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Returns the largest integral value (with FLOAT64
+type) that is not greater than X.</p>
+
+<h3 id="example-rounding-function-behavior">Example rounding function behavior</h3>
+<p>Example behavior of Cloud Dataflow SQL rounding functions:</p>
+
+<table class="table">
+<thead>
+<tr>
+<th>Input "X"</th>
+<th>CEIL(X)</th>
+<th>FLOOR(X)</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>2.0</td>
+<td>2.0</td>
+<td>2.0</td>
+</tr>
+<tr>
+<td>2.3</td>
+<td>3.0</td>
+<td>2.0</td>
+</tr>
+<tr>
+<td>2.8</td>
+<td>3.0</td>
+<td>2.0</td>
+</tr>
+<tr>
+<td>2.5</td>
+<td>3.0</td>
+<td>2.0</td>
+</tr>
+<tr>
+<td>-2.3</td>
+<td>-2.0</td>
+<td>-3.0</td>
+</tr>
+<tr>
+<td>-2.8</td>
+<td>-2.0</td>
+<td>-3.0</td>
+</tr>
+<tr>
+<td>-2.5</td>
+<td>-2.0</td>
+<td>-3.0</td>
+</tr>
+<tr>
+<td>0</td>
+<td>0</td>
+<td>0</td>
+</tr>
+</tbody>
+</table>
+
</div>
</div>
<!--
diff --git a/website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html b/website/generated-content/documentation/dsls/sql/zetasql/operators/index.html
similarity index 54%
copy from website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/operators/index.html
index 6fbe68f..e043d3d 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/scalar-functions/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/operators/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL scalar functions in Calcite</title>
+ <title>Beam ZetaSQL operators</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/calcite/scalar-functions/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/operators/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/calcite/scalar-functions.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/operators.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -261,13 +284,11 @@
<ul class="nav">
- <li><a href="#comparison-functions-and-operators">Comparison functions and operators</a></li>
- <li><a href="#logical-functions-and-operators">Logical functions and operators</a></li>
- <li><a href="#arithmetic-expressions">Arithmetic expressions</a></li>
- <li><a href="#math-functions">Math functions</a></li>
- <li><a href="#date-functions">Date functions</a></li>
- <li><a href="#string-functions">String functions</a></li>
- <li><a href="#conditional-functions">Conditional functions</a></li>
+ <li><a href="#element-access-operators">Element access operators</a></li>
+ <li><a href="#arithmetic-operators">Arithmetic operators</a></li>
+ <li><a href="#logical-operators">Logical operators</a></li>
+ <li><a href="#comparison-operators">Comparison operators</a></li>
+ <li><a href="#is-operators">IS operators</a></li>
</ul>
@@ -288,371 +309,569 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-scalar-functions-calcite">Beam SQL scalar functions (Calcite)</h1>
+<h1 id="beam-zetasql-operators">Beam ZetaSQL operators</h1>
-<p>This page documents built-in functions supported by Beam SQL when using Apache Calcite.</p>
+<p>Operators are represented by special characters or keywords; they do not use
+function call syntax. An operator manipulates any number of data inputs, also
+called operands, and returns a result.</p>
-<p>See also <a href="http://calcite.apache.org/docs/reference.html#operators-and-functions">Calcite
-SQL’s operators and functions
-reference</a>.</p>
+<p>Common conventions:</p>
-<h2 id="comparison-functions-and-operators">Comparison functions and operators</h2>
-
-<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>value1 = value2</td>
- <td>Equals</td>
- </tr>
- <tr>
- <td>value1 <> value2</td>
- <td>Not equal</td>
- </tr>
- <tr>
- <td>value1 > value2</td>
- <td>Greater than</td>
- </tr>
- <tr>
- <td>value1 >= value2</td>
- <td>Greater than or equal</td>
- </tr>
- <tr>
- <td>value1 < value2</td>
- <td>Less than</td>
- </tr>
- <tr>
- <td>value1 <= value2</td>
- <td>Less than or equal</td>
- </tr>
- <tr>
- <td>value IS NULL</td>
- <td>Whether value is null</td>
- </tr>
- <tr>
- <td>value IS NOT NULL</td>
- <td>Whether value is not null</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="logical-functions-and-operators">Logical functions and operators</h2>
-
-<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>boolean1 OR boolean2</td>
- <td>Whether boolean1 is TRUE or boolean2 is TRUE</td>
- </tr>
- <tr>
- <td>boolean1 AND boolean2</td>
- <td>Whether boolean1 and boolean2 are both TRUE</td>
- </tr>
- <tr>
- <td>NOT boolean</td>
- <td>Whether boolean is not TRUE; returns UNKNOWN if boolean is UNKNOWN</td>
- </tr>
- </tbody>
-</table>
+<ul>
+ <li>Unless otherwise specified, all operators return <code class="highlighter-rouge">NULL</code> when one of the
+operands is <code class="highlighter-rouge">NULL</code>.</li>
+</ul>
-<h2 id="arithmetic-expressions">Arithmetic expressions</h2>
+<p>The following table lists all supported operators from highest to
+lowest precedence. Precedence determines the order in which operators will be evaluated within a statement.</p>
<table class="table">
<thead>
<tr>
- <th>Operator syntax</th>
- <th>Description</th>
+ <th>Order of Precedence</th>
+ <th>Operator</th>
+ <th>Input Data Types</th>
+ <th>Name</th>
+ <th>Operator Arity</th>
</tr>
</thead>
<tbody>
<tr>
- <td>numeric1 + numeric2</td>
- <td>Returns numeric1 plus numeric2</td>
+ <td>1</td>
+ <td>.</td>
+ <td><span> STRUCT</span><br /></td>
+ <td>Member field access operator</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>numeric1 - numeric2</td>
- <td>Returns numeric1 minus numeric2</td>
+ <td> </td>
+ <td>[ ]</td>
+ <td>ARRAY</td>
+ <td>Array position. Must be used with OFFSET or ORDINAL&mdash.</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>numeric1 * numeric2</td>
- <td>Returns numeric1 multiplied by numeric2</td>
+ <td>2</td>
+ <td>-</td>
+ <td>All numeric types</td>
+ <td>Unary minus</td>
+ <td>Unary</td>
</tr>
<tr>
- <td>numeric1 / numeric2</td>
- <td>Returns numeric1 divided by numeric2</td>
+ <td>3</td>
+ <td>*</td>
+ <td>All numeric types</td>
+ <td>Multiplication</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>MOD(numeric, numeric)</td>
- <td>Returns the remainder (modulus) of numeric1 divided by numeric2. The result is negative only if numeric1 is negative</td>
+ <td> </td>
+ <td>/</td>
+ <td>All numeric types</td>
+ <td>Division</td>
+ <td>Binary</td>
</tr>
- </tbody>
-</table>
-
-<h2 id="math-functions">Math functions</h2>
-
-<table class="table">
- <thead>
<tr>
- <th>Operator syntax</th>
- <th>Description</th>
+ <td>4</td>
+ <td>+</td>
+ <td>All numeric types</td>
+ <td>Addition</td>
+ <td>Binary</td>
</tr>
- </thead>
- <tbody>
<tr>
- <td>ABS(numeric)</td>
- <td>Returns the absolute value of numeric</td>
+ <td> </td>
+ <td>-</td>
+ <td>All numeric types</td>
+ <td>Subtraction</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>SQRT(numeric)</td>
- <td>Returns the square root of numeric</td>
+ <td>5 (Comparison Operators)</td>
+ <td>=</td>
+ <td>Any comparable type. See
+ <a href="/documentation/dsls/sql/zetasql/data-types">Data Types</a> for
+ a complete list.</td>
+ <td>Equal</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>LN(numeric)</td>
- <td>Returns the natural logarithm (base e) of numeric</td>
+ <td> </td>
+ <td><</td>
+ <td>Any comparable type. See
+ <a href="/documentation/dsls/sql/zetasql/data-types">Data Types</a> for
+ a complete list.</td>
+ <td>Less than</td>
+ <td>Binary</td>
+ </tr>
+ <tr>
+ <td> </td>
+ <td>></td>
+ <td>Any comparable type. See
+ <a href="/documentation/dsls/sql/zetasql/data-types">Data Types</a> for
+ a complete list.</td>
+ <td>Greater than</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>LOG10(numeric)</td>
- <td>Returns the base 10 logarithm of numeric</td>
+ <td> </td>
+ <td><=</td>
+ <td>Any comparable type. See
+ <a href="/documentation/dsls/sql/zetasql/data-types">Data Types</a> for
+ a complete list.</td>
+ <td>Less than or equal to</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>EXP(numeric)</td>
- <td>Returns e raised to the power of numeric</td>
+ <td> </td>
+ <td>>=</td>
+ <td>Any comparable type. See
+ <a href="/documentation/dsls/sql/zetasql/data-types">Data Types</a> for
+ a complete list.</td>
+ <td>Greater than or equal to</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>ACOS(numeric)</td>
- <td>Returns the arc cosine of numeric</td>
+ <td> </td>
+ <td>!=, <></td>
+ <td>Any comparable type. See
+ <a href="/documentation/dsls/sql/zetasql/data-types">Data Types</a> for
+ a complete list.</td>
+ <td>Not equal</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>ASIN(numeric)</td>
- <td>Returns the arc sine of numeric</td>
+ <td> </td>
+ <td>[NOT] LIKE</td>
+ <td>STRING and byte</td>
+ <td>Value does [not] match the pattern specified</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>ATAN(numeric)</td>
- <td>Returns the arc tangent of numeric</td>
+ <td> </td>
+ <td>[NOT] BETWEEN</td>
+ <td>Any comparable types. See Data Types for list.</td>
+ <td>Value is [not] within the range specified</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>COT(numeric)</td>
- <td>Returns the cotangent of numeric</td>
+ <td> </td>
+ <td>[NOT] IN</td>
+ <td>Any comparable types. See Data Types for list.</td>
+ <td>Value is [not] in the set of values specified</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>DEGREES(numeric)</td>
- <td>Converts numeric from radians to degrees</td>
+ <td> </td>
+ <td>IS [NOT] <code>NULL</code></td>
+ <td>All</td>
+ <td>Value is [not] <code>NULL</code></td>
+ <td>Unary</td>
</tr>
<tr>
- <td>RADIANS(numeric)</td>
- <td>Converts numeric from degrees to radians</td>
+ <td> </td>
+ <td>IS [NOT] TRUE</td>
+ <td>BOOL</td>
+ <td>Value is [not] TRUE.</td>
+ <td>Unary</td>
</tr>
<tr>
- <td>SIGN(numeric)</td>
- <td>Returns the signum of numeric</td>
+ <td> </td>
+ <td>IS [NOT] FALSE</td>
+ <td>BOOL</td>
+ <td>Value is [not] FALSE.</td>
+ <td>Unary</td>
</tr>
<tr>
- <td>SIN(numeric)</td>
- <td>Returns the sine of numeric</td>
+ <td>6</td>
+ <td>NOT</td>
+ <td>BOOL</td>
+ <td>Logical NOT</td>
+ <td>Unary</td>
</tr>
<tr>
- <td>TAN(numeric)</td>
- <td>Returns the tangent of numeric</td>
+ <td>7</td>
+ <td>AND</td>
+ <td>BOOL</td>
+ <td>Logical AND</td>
+ <td>Binary</td>
</tr>
<tr>
- <td>ROUND(numeric1, numeric2)</td>
- <td>Rounds numeric1 to numeric2 places right to the decimal point</td>
+ <td>8</td>
+ <td>OR</td>
+ <td>BOOL</td>
+ <td>Logical OR</td>
+ <td>Binary</td>
</tr>
</tbody>
</table>
-<h2 id="date-functions">Date functions</h2>
+<p>Operators with the same precedence are left associative. This means that those
+operators are grouped together starting from the left and moving right. For
+example, the expression:</p>
+
+<p><code class="highlighter-rouge">x AND y AND z</code></p>
+
+<p>is interpreted as</p>
+
+<p><code class="highlighter-rouge">( ( x AND y ) AND z )</code></p>
+
+<p>The expression:</p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>x * y / z
+</code></pre>
+</div>
+
+<p>is interpreted as:</p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>( ( x * y ) / z )
+</code></pre>
+</div>
+
+<p>All comparison operators have the same priority and are grouped using left
+associativity. However, comparison operators are not associative. As a result,
+it is recommended that you use parentheses to improve readability and ensure
+expressions are resolved as desired. For example:</p>
+
+<p><code class="highlighter-rouge">(x < y) IS FALSE</code></p>
+
+<p>is recommended over:</p>
+
+<p><code class="highlighter-rouge">x < y IS FALSE</code></p>
+
+<h2 id="element-access-operators">Element access operators</h2>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>LOCALTIME</td>
- <td>Returns the current date and time in the session time zone in a value of datatype TIME</td>
- </tr>
- <tr>
- <td>LOCALTIME(precision)</td>
- <td>Returns the current date and time in the session time zone in a value of datatype TIME, with precision digits of precision</td>
- </tr>
- <tr>
- <td>LOCALTIMESTAMP</td>
- <td>Returns the current date and time in the session time zone in a value of datatype TIMESTAMP</td>
- </tr>
- <tr>
- <td>LOCALTIMESTAMP(precision)</td>
- <td>Returns the current date and time in the session time zone in a value of datatype TIMESTAMP, with precision digits of precision</td>
- </tr>
- <tr>
- <td>CURRENT_TIME</td>
- <td>Returns the current time in the session time zone, in a value of datatype TIMESTAMP WITH TIME ZONE</td>
- </tr>
- <tr>
- <td>CURRENT_DATE</td>
- <td>Returns the current date in the session time zone, in a value of datatype DATE</td>
- </tr>
- <tr>
- <td>CURRENT_TIMESTAMP</td>
- <td>Returns the current date and time in the session time zone, in a value of datatype TIMESTAMP WITH TIME ZONE</td>
- </tr>
- <tr>
- <td>EXTRACT(timeUnit FROM datetime)</td>
- <td>Extracts and returns the value of a specified datetime field from a datetime value expression</td>
- </tr>
- <tr>
- <td>FLOOR(datetime TO timeUnit)</td>
- <td>Rounds datetime down to timeUnit</td>
- </tr>
- <tr>
- <td>CEIL(datetime TO timeUnit)</td>
- <td>Rounds datetime up to timeUnit</td>
- </tr>
- <tr>
- <td>YEAR(date)</td>
- <td>Equivalent to EXTRACT(YEAR FROM date). Returns an integer.</td>
- </tr>
- <tr>
- <td>QUARTER(date)</td>
- <td>Equivalent to EXTRACT(QUARTER FROM date). Returns an integer between 1 and 4.</td>
- </tr>
- <tr>
- <td>MONTH(date)</td>
- <td>Equivalent to EXTRACT(MONTH FROM date). Returns an integer between 1 and 12.</td>
- </tr>
- <tr>
- <td>WEEK(date)</td>
- <td>Equivalent to EXTRACT(WEEK FROM date). Returns an integer between 1 and 53.</td>
- </tr>
- <tr>
- <td>DAYOFYEAR(date)</td>
- <td>Equivalent to EXTRACT(DOY FROM date). Returns an integer between 1 and 366.</td>
- </tr>
- <tr>
- <td>DAYOFMONTH(date)</td>
- <td>Equivalent to EXTRACT(DAY FROM date). Returns an integer between 1 and 31.</td>
- </tr>
- <tr>
- <td>DAYOFWEEK(date)</td>
- <td>Equivalent to EXTRACT(DOW FROM date). Returns an integer between 1 and 7.</td>
- </tr>
- <tr>
- <td>HOUR(date)</td>
- <td>Equivalent to EXTRACT(HOUR FROM date). Returns an integer between 0 and 23.</td>
- </tr>
- <tr>
- <td>MINUTE(date)</td>
- <td>Equivalent to EXTRACT(MINUTE FROM date). Returns an integer between 0 and 59.</td>
- </tr>
- <tr>
- <td>SECOND(date)</td>
- <td>Equivalent to EXTRACT(SECOND FROM date). Returns an integer between 0 and 59.</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Operator</th>
+<th>Syntax</th>
+<th>Input Data Types</th>
+<th>Result Data Type</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>.</td>
+<td>expression.fieldname1...</td>
+<td><span> STRUCT</span><br /></td>
+<td>Type T stored in fieldname1</td>
+<td>Dot operator. Can be used to access nested fields,
+e.g.expression.fieldname1.fieldname2...</td>
+</tr>
+<tr>
+<td>[ ]</td>
+<td>array_expression [position_keyword (int_expression ) ]</td>
+<td>See ARRAY Functions.</td>
+<td>Type T stored in ARRAY</td>
+<td>position_keyword is either OFFSET or ORDINAL.</td>
+</tr>
+</tbody>
</table>
-<h2 id="string-functions">String functions</h2>
+<h2 id="arithmetic-operators">Arithmetic operators</h2>
+
+<p>All arithmetic operators accept input of numeric type T, and the result type
+has type T unless otherwise indicated in the description below:</p>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>string || string</td>
- <td>Concatenates two character strings</td>
- </tr>
- <tr>
- <td>CHAR_LENGTH(string)</td>
- <td>Returns the number of characters in a character string</td>
- </tr>
- <tr>
- <td>CHARACTER_LENGTH(string)</td>
- <td>As CHAR_LENGTH(string)</td>
- </tr>
- <tr>
- <td>UPPER(string)</td>
- <td>Returns a character string converted to upper case</td>
- </tr>
- <tr>
- <td>LOWER(string)</td>
- <td>Returns a character string converted to lower case</td>
- </tr>
- <tr>
- <td>POSITION(string1 IN string2)</td>
- <td>Returns the position of the first occurrence of string1 in string2</td>
- </tr>
- <tr>
- <td>POSITION(string1 IN string2 FROM integer)</td>
- <td>Returns the position of the first occurrence of string1 in string2 starting at a given point (not standard SQL)</td>
- </tr>
- <tr>
- <td>TRIM( { BOTH | LEADING | TRAILING } string1 FROM string2)</td>
- <td>Removes the longest string containing only the characters in string1 from the start/end/both ends of string1</td>
- </tr>
- <tr>
- <td>OVERLAY(string1 PLACING string2 FROM integer [ FOR integer2 ])</td>
- <td>Replaces a substring of string1 with string2</td>
- </tr>
- <tr>
- <td>SUBSTRING(string FROM integer)</td>
- <td>Returns a substring of a character string starting at a given point</td>
- </tr>
- <tr>
- <td>SUBSTRING(string FROM integer FOR integer)</td>
- <td>Returns a substring of a character string starting at a given point with a given length</td>
- </tr>
- <tr>
- <td>INITCAP(string)</td>
- <td>Returns string with the first letter of each word converter to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters.</td>
- </tr>
- </tbody>
+<thead>
+<tr>
+<th>Name</th>
+<th>Syntax</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Addition</td>
+<td>X + Y</td>
+</tr>
+<tr>
+<td>Subtraction</td>
+<td>X - Y</td>
+</tr>
+<tr>
+<td>Multiplication</td>
+<td>X * Y</td>
+</tr>
+<tr>
+<td>Division</td>
+<td>X / Y</td>
+</tr>
+<tr>
+<td>Unary Minus</td>
+<td>- X</td>
+</tr>
+</tbody>
</table>
-<h2 id="conditional-functions">Conditional functions</h2>
+<p>Result types for Addition and Multiplication:</p>
<table class="table">
- <thead>
- <tr>
- <th>Operator syntax</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>CASE value <br />WHEN value1 [, value11 ]* THEN result1 <br />[ WHEN valueN [, valueN1 ]* THEN resultN ]* <br />[ ELSE resultZ ] <br />END</td>
- <td>Simple case</td>
- </tr>
- <tr>
- <td>CASE <br />WHEN condition1 THEN result1 <br />[ WHEN conditionN THEN resultN ]* <br />[ ELSE resultZ ] <br />END</td>
- <td>Searched case</td>
- </tr>
- <tr>
- <td>NULLIF(value, value)</td>
- <td>Returns NULL if the values are the same. For example, NULLIF(5, 5) returns NULL; NULLIF(5, 0) returns 5.</td>
- </tr>
- <tr>
- <td>COALESCE(value, value [, value ]*)</td>
- <td>Provides a value if the first value is null. For example, COALESCE(NULL, 5) returns 5.</td>
- </tr>
- </tbody>
+<thead>
+<tr><th> </th><th>INT64</th><th>FLOAT64</th></tr>
+</thead>
+<tbody><tr><td>INT64</td><td>INT64</td><td>FLOAT64</td></tr><tr><td>FLOAT64</td><td>FLOAT64</td><td>FLOAT64</td></tr></tbody>
+</table>
+
+<p>Result types for Subtraction:</p>
+
+<table class="table">
+<thead>
+<tr><th> </th><th>INT64</th><th>FLOAT64</th></tr>
+</thead>
+<tbody><tr><td>INT64</td><td>INT64</td><td>FLOAT64</td></tr><tr><td>FLOAT64</td><td>FLOAT64</td><td>FLOAT64</td></tr></tbody>
+</table>
+
+<p>Result types for Division:</p>
+
+<table class="table">
+<thead>
+ <tr><th> </th><th>INT64</th><th>FLOAT64</th></tr>
+</thead>
+<tbody><tr><td>INT64</td><td>FLOAT64</td><td>FLOAT64</td></tr><tr><td>FLOAT64</td><td>FLOAT64</td><td>FLOAT64</td></tr></tbody>
+</table>
+
+<p>Result types for Unary Minus:</p>
+
+<table class="table">
+<thead>
+<tr>
+<th>Input Data Type</th>
+<th>Result Data Type</th>
+</tr>
+</thead>
+<tbody>
+
+<tr>
+<td>INT64</td>
+<td>INT64</td>
+</tr>
+
+<tr>
+<td>FLOAT64</td>
+<td>FLOAT64</td>
+</tr>
+
+</tbody>
+</table>
+
+<h2 id="logical-operators">Logical operators</h2>
+
+<p>All logical operators allow only BOOL input.</p>
+
+<table class="table">
+<thead>
+<tr>
+<th>Name</th>
+<th>Syntax</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Logical NOT</td>
+<td nowrap="">NOT X</td>
+<td>Returns FALSE if input is TRUE. Returns TRUE if input is FALSE. Returns <code>NULL</code>
+otherwise.</td>
+</tr>
+<tr>
+<td>Logical AND</td>
+<td nowrap="">X AND Y</td>
+<td>Returns FALSE if at least one input is FALSE. Returns TRUE if both X and Y
+are TRUE. Returns <code>NULL</code> otherwise.</td>
+</tr>
+<tr>
+<td>Logical OR</td>
+<td nowrap="">X OR Y</td>
+<td>Returns FALSE if both X and Y are FALSE. Returns TRUE if at least one input
+is TRUE. Returns <code>NULL</code> otherwise.</td>
+</tr>
+</tbody>
+</table>
+
+<h2 id="comparison-operators">Comparison operators</h2>
+
+<p>Comparisons always return BOOL. Comparisons generally
+require both operands to be of the same type. If operands are of different
+types, and if Cloud Dataflow SQL can convert the values of those types to a
+common type without loss of precision, Cloud Dataflow SQL will generally coerce
+them to that common type for the comparison; Cloud Dataflow SQL will generally
+<a href="/documentation/dsls/sql/zetasql/conversion-rules/#coercion">coerce literals to the type of non-literals</a>, where
+present. Comparable data types are defined in
+<a href="/documentation/dsls/sql/zetasql/data-types">Data Types</a>.</p>
+
+<p>STRUCTs support only 4 comparison operators: equal
+(=), not equal (!= and <>), and IN.</p>
+
+<p>The following rules apply when comparing these data types:</p>
+
+<ul>
+ <li>
+ <dl>
+ <dt>FLOAT64</dt>
+ <dd>All comparisons with NaN return FALSE,
+except for <code class="highlighter-rouge">!=</code> and <code class="highlighter-rouge"><></code>, which return TRUE.</dd>
+ </dl>
+ </li>
+ <li>BOOL: FALSE is less than TRUE.</li>
+ <li>STRING: Strings are
+compared codepoint-by-codepoint, which means that canonically equivalent
+strings are only guaranteed to compare as equal if
+they have been normalized first.</li>
+ <li><code class="highlighter-rouge">NULL</code>: The convention holds here: any operation with a <code class="highlighter-rouge">NULL</code> input returns
+<code class="highlighter-rouge">NULL</code>.</li>
+</ul>
+
+<table class="table">
+<thead>
+<tr>
+<th>Name</th>
+<th>Syntax</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Less Than</td>
+<td>X < Y</td>
+<td>Returns TRUE if X is less than Y.</td>
+</tr>
+<tr>
+<td>Less Than or Equal To</td>
+<td>X <= Y</td>
+<td>Returns TRUE if X is less than or equal to Y.</td>
+</tr>
+<tr>
+<td>Greater Than</td>
+<td>X > Y</td>
+<td>Returns TRUE if X is greater than Y.</td>
+</tr>
+<tr>
+<td>Greater Than or Equal To</td>
+<td>X >= Y</td>
+<td>Returns TRUE if X is greater than or equal to Y.</td>
+</tr>
+<tr>
+<td>Equal</td>
+<td>X = Y</td>
+<td>Returns TRUE if X is equal to Y.</td>
+</tr>
+<tr>
+<td>Not Equal</td>
+<td>X != Y<br />X <> Y</td>
+<td>Returns TRUE if X is not equal to Y.</td>
+</tr>
+<tr>
+<td>BETWEEN</td>
+<td>X [NOT] BETWEEN Y AND Z</td>
+<td>Returns TRUE if X is [not] within the range specified. The result of "X
+BETWEEN Y AND Z" is equivalent to "Y <= X AND X <= Z" but X is evaluated
+only once in the former.</td>
+</tr>
+<tr>
+<td>LIKE</td>
+<td>X [NOT] LIKE Y</td>
+<td>Checks if the STRING in the first operand X
+matches a pattern specified by the second operand Y. Expressions can contain
+these characters:
+<ul>
+<li>A percent sign "%" matches any number of characters or bytes</li>
+<li>An underscore "_" matches a single character or byte</li>
+<li>You can escape "\", "_", or "%" using two backslashes. For example, <code>
+"\\%"</code>. If you are using raw strings, only a single backslash is
+required. For example, <code>r"\%"</code>.</li>
+</ul>
+</td>
+</tr>
+<tr>
+<td>IN</td>
+<td>Multiple - see below</td>
+<td>Returns FALSE if the right operand is empty. Returns <code>NULL</code> if the left
+operand is <code>NULL</code>. Returns TRUE or <code>NULL</code>, never FALSE, if the right operand
+contains <code>NULL</code>. Arguments on either side of IN are general expressions. Neither
+operand is required to be a literal, although using a literal on the right is
+most common. X is evaluated only once.</td>
+</tr>
+</tbody>
+</table>
+
+<p>When testing values that have a STRUCT data type for
+equality, it’s possible that one or more fields are <code class="highlighter-rouge">NULL</code>. In such cases:</p>
+
+<ul>
+ <li>If all non-NULL field values are equal, the comparison returns NULL.</li>
+ <li>If any non-NULL field values are not equal, the comparison returns false.</li>
+</ul>
+
+<p>The following table demonstrates how STRUCT data
+types are compared when they have fields that are <code class="highlighter-rouge">NULL</code> valued.</p>
+
+<table class="table">
+<thead>
+<tr>
+<th>Struct1</th>
+<th>Struct2</th>
+<th>Struct1 = Struct2</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><code>STRUCT(1, NULL)</code></td>
+<td><code>STRUCT(1, NULL)</code></td>
+<td><code>NULL</code></td>
+</tr>
+<tr>
+<td><code>STRUCT(1, NULL)</code></td>
+<td><code>STRUCT(2, NULL)</code></td>
+<td><code>FALSE</code></td>
+</tr>
+<tr>
+<td><code>STRUCT(1,2)</code></td>
+<td><code>STRUCT(1, NULL)</code></td>
+<td><code>NULL</code></td>
+</tr>
+</tbody>
+</table>
+
+<h2 id="is-operators">IS operators</h2>
+
+<p>IS operators return TRUE or FALSE for the condition they are testing. They never
+return <code class="highlighter-rouge">NULL</code>, even for <code class="highlighter-rouge">NULL</code> inputs. If NOT is present, the output BOOL value
+is inverted.</p>
+
+<table class="table">
+<thead>
+<tr>
+<th>Function Syntax</th>
+<th>Input Data Type</th>
+<th>Result Data Type</th>
+<th>Description</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+ <td><pre>X IS [NOT] NULL</pre></td>
+<td>Any value type</td>
+<td>BOOL</td>
+<td>Returns TRUE if the operand X evaluates to <code>NULL</code>, and returns FALSE
+otherwise.</td>
+</tr>
+<tr>
+ <td><pre>X IS [NOT] TRUE</pre></td>
+<td>BOOL</td>
+<td>BOOL</td>
+<td>Returns TRUE if the BOOL operand evaluates to TRUE. Returns FALSE
+otherwise.</td>
+</tr>
+<tr>
+ <td><pre>X IS [NOT] FALSE</pre></td>
+<td>BOOL</td>
+<td>BOOL</td>
+<td>Returns TRUE if the BOOL operand evaluates to FALSE. Returns FALSE
+otherwise.</td>
+</tr>
+</tbody>
</table>
</div>
diff --git a/website/generated-content/documentation/dsls/sql/calcite/overview/index.html b/website/generated-content/documentation/dsls/sql/zetasql/overview/index.html
similarity index 71%
copy from website/generated-content/documentation/dsls/sql/calcite/overview/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/overview/index.html
index 43989c1..470bb85 100644
--- a/website/generated-content/documentation/dsls/sql/calcite/overview/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/overview/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL in Calcite: Overview</title>
+ <title>Beam ZetaSQL overview</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/calcite/overview/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/overview/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/calcite/overview.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/overview.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -284,61 +307,50 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="calcite-support-overview">Calcite support overview</h1>
+<h1 id="beam-zetasql-overview">Beam ZetaSQL overview</h1>
+<p>Beam SQL supports a varient of the <a href="https://github.com/google/zetasql">ZetaSQL</a> language. ZetaSQL is similar to the language in BigQuery’s SQL framework. This Beam SQL dialect is especially useful in pipelines that <a href="https://beam.apache.org/releases/javadoc/current/org/apache/beam/sdk/io/gcp/bigquery/BigQueryIO.html">write to or read from BigQuery tables</a>.</p>
-<p><a href="http://calcite.apache.org">Apache Calcite</a> is a widespread SQL dialect used in
-big data processing with some streaming enhancements. Calcite provides the
-basic dialect underlying Beam SQL.</p>
-
-<p>We have added additional extensions to
-make it easy to leverage Beam’s unified batch/streaming model and support
-for complex data types.</p>
+<p>Beam SQL has additional extensions leveraging Beam’s unified batch/streaming model and processing complex data types. You can use these extensions with all Beam SQL dialects, including Beam ZetaSQL.</p>
<h2 id="query-syntax">Query syntax</h2>
-<p>Query statements scan one or more tables or expressions and return the computed result rows.
-The <a href="/documentation/dsls/sql/calcite/query-syntax">Query syntax</a> page describes Beam SQL’s syntax for queries when using Apache Calcite.</p>
+<p>Query statements scan tables or expressions and return the computed result rows. For more information about query statements in Beam ZetaSQL, see the <a href="/documentation/dsls/sql/zetasql/query-syntax">Query syntax</a> reference and <a href="/documentation/dsls/sql/zetasql/syntax">Function call rules</a>.</p>
<h2 id="lexical-structure">Lexical structure</h2>
-<p>A Beam SQL statement comprises a series of tokens.
-The <a href="/documentation/dsls/sql/calcite/lexical">Lexical structure</a> page documents Beam SQL’s lexical structure when using Apache Calcite.</p>
+<p>A Beam SQL statement comprises a series of tokens. For more information about tokens in Beam ZetaSQL, see the <a href="/documentation/dsls/sql/zetasql/lexical">Lexical structure</a> reference.</p>
<h2 id="data-types">Data types</h2>
-<p>Beam SQL supports standard SQL scalar data types as well as extensions including arrays, maps, and nested rows.
-Read about supported <a href="/documentation/dsls/sql/calcite/data-types">data types</a> in Beam SQL when using Apache Calcite.</p>
+<p>Beam SQL supports standard SQL scalar data types as well as extensions including arrays, maps, and nested rows. For more information about scalar data in Beam ZetaSQL, see the <a href="/documentation/dsls/sql/zetasql/data-types">Data types</a> reference.</p>
<h2 id="functions-and-operators">Functions and operators</h2>
-<p>The following table summarizes Apache Calcite operators and functions supported by Beam SQL.</p>
-
+<p>The following table summarizes the <a href="https://github.com/google/zetasql/blob/master/docs/functions-and-operators.md">ZetaSQL functions and operators</a> supported by Beam ZetaSQL.</p>
<table class="table-bordered table-striped">
- <tr><th>Operators and functions</th><th>Beam SQL support status</th></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#operator-precedence">Operator precedence</a></td><td>Yes</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#comparison-operators">Comparison operators</a></td><td class="style1">See Beam SQL <a href="/documentation/dsls/sql/calcite/scalar-functions/#comparison-functions-and-operators">scalar functions</a></td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#logical-operators">Logical operators</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/calcite/scalar-functions/#logical-functions-and-operators">scalar functions</a></td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#arithmetic-operators-and-functions">Arithmetic operators and functions</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/calcite/scalar-functions/#arithmetic-expressions">scalar functions</a></td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#character-string-operators-and-functions">Character string operators and functions</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/calcite/scalar-functions/#string-functions">scalar functions</a></td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#binary-string-operators-and-functions">Binary string operators and functions</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#datetime-functions">Date/time functions</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/calcite/scalar-functions/#date-functions">scalar functions</a></td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#system-functions">System functions</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#conditional-functions-and-operators">Conditional functions and operators</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/calcite/scalar-functions/#conditional-functions">scalar functions</a></td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#type-conversion">Type conversion</a></td><td>Yes</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#value-constructors">Value constructors</a></td><td>No, except array</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#collection-functions">Collection functions</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#period-predicates">Period predicates</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#jdbc-function-escape">JDBC function escape</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#aggregate-functions">Aggregate functions</a></td>
-<td>See Beam SQL extension <a href="/documentation/dsls/sql/calcite/aggregate-functions/">aggregate functions</a></td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#window-functions">Window functions</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#grouping-functions">Grouping functions</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#grouped-window-functions">Grouped window functions</a></td><td>See Beam SQL extension <a href="/documentation/dsls/sql/windowing-and-triggering/">windowing and triggering</a></td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#grouped-auxiliary-functions">Grouped auxiliary functions</a></td><td>Yes, except SESSION_END</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#spatial-functions">Spatial functions</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#geometry-creation-functions-3d">Geometry creation functions (3D)</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#geometry-predicates">Geometry predicates</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#json-functions">JSON functions</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#user-defined-functions">User-defined functions</a></td>
-<td>See Beam SQL extension <a href="/documentation/dsls/sql/user-defined-functions/">user-defined functions</a>. You cannot call functions with <a href="http://calcite.apache.org/docs/reference.html#calling-functions-with-named-and-optional-parameters">named and optional parameters</a>.</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#match_recognize">MATCH_RECOGNIZE</a></td><td>No</td></tr>
-<tr><td><a href="http://calcite.apache.org/docs/reference.html#ddl-extensions">DDL Extensions</a></td><td>See Beam SQL extension <a href="/documentation/dsls/sql/create-external-table/">CREATE EXTERNAL TABLE</a></td></tr>
+ <tr><th>Operators and functions</th><th>Beam ZetaSQL support</th></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/conversion_rules.md">Type conversion</a></td><td>Yes</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/aggregate_functions.md">Aggregate functions</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/zetasql/aggregate-functions">aggregate functions</a></td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/statistical_aggregate_functions.md">Statistical aggregate functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/approximate_aggregate_functions.md">Approximate aggregate functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/hll_functions.md">HyperLogLog++ functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/functions-and-operators.md#kll16-quantile-functions">KLL16 quantile functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/numbering_functions.md">Numbering functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/bit_functions.md">Bit functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/mathematical_functions.md">Mathematical functions</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/zetasql/math-functions">mathematical functions</a></td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/navigation_functions.md">Navigation functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/aggregate_analytic_functions.md">Aggregate analytic functions</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/zetasql/aggregate-functions">aggregate functions</a></td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/hash_functions.md">Hash functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/string_functions.md">String functions</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/zetasql/string-functions">string functions</a></td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/json_functions.md">JSON functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/array_functions.md">Array functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/date_functions.md">Date functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/datetime_functions.md">DateTime functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/time_functions.md">Time functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/timestamp_functions.md">Timestamp functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/protocol-buffers.md">Protocol buffer functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/security_functions.md">Security functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/net_functions.md">Net functions</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/operators.md">Operator precedence</a></td><td>Yes</td></tr>
+ <tr><td><a href="">Conditional expressions</a></td><td>See Beam SQL <a href="/documentation/dsls/sql/zetasql/conditional-expressions">conditional expressions</a></td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/expression_subqueries.md">Expression subqueries</a></td><td>No</td></tr>
+ <tr><td><a href="https://github.com/google/zetasql/blob/master/docs/debugging_functions.md">Debugging functions</a></td><td>No</td></tr>
</table>
</div>
diff --git a/website/generated-content/documentation/dsls/sql/zetasql/query-syntax/index.html b/website/generated-content/documentation/dsls/sql/zetasql/query-syntax/index.html
new file mode 100644
index 0000000..9eaa8d5
--- /dev/null
+++ b/website/generated-content/documentation/dsls/sql/zetasql/query-syntax/index.html
@@ -0,0 +1,1621 @@
+<!DOCTYPE html>
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+
+<html lang="en">
+ <!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>Beam ZetaSQL query syntax</title>
+ <meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
+">
+ <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
+ <link rel="stylesheet" href="/css/site.css">
+ <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
+ <script src="/js/bootstrap.min.js"></script>
+ <script src="/js/language-switch.js"></script>
+ <script src="/js/fix-menu.js"></script>
+ <script src="/js/section-nav.js"></script>
+ <script src="/js/page-nav.js"></script>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/query-syntax/" data-proofer-ignore>
+ <link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
+ <link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-73650088-1', 'auto');
+ ga('send', 'pageview');
+ </script>
+</head>
+
+ <body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+ <!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+
+<nav class="header navbar navbar-fixed-top">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" aria-expanded="false" aria-controls="navbar">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+
+ <a href="/" class="navbar-brand" >
+ <img alt="Brand" style="height: 25px" src="/images/beam_logo_navbar.png">
+ </a>
+ </div>
+
+ <div class="navbar-mask closed"></div>
+
+ <div id="navbar" class="navbar-container closed">
+ <ul class="nav navbar-nav">
+ <li>
+ <a href="/get-started/beam-overview/">Get Started</a>
+ </li>
+ <li>
+ <a href="/documentation/">Documentation</a>
+ </li>
+ <li>
+ <a href="/documentation/sdks/java/">Languages</a>
+ </li>
+ <li>
+ <a href="/documentation/runners/capability-matrix/">RUNNERS</a>
+ </li>
+ <li>
+ <a href="/roadmap/">Roadmap</a>
+ </li>
+ <li>
+ <a href="/contribute/">Contribute</a>
+ </li>
+ <li>
+ <a href="/community/contact-us/">Community</a>
+ </li>
+ <li><a href="/blog">Blog</a></li>
+ </ul>
+ <ul class="nav navbar-nav navbar-right">
+ <li>
+ <div style="width: 300px;">
+ <script>
+ (function() {
+ var cx = '012923275103528129024:4emlchv9wzi';
+ var gcse = document.createElement('script');
+ gcse.type = 'text/javascript';
+ gcse.async = true;
+ gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(gcse, s);
+ })();
+ </script>
+ <gcse:search></gcse:search>
+ </div>
+ </li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><img src="https://www.apache.org/foundation/press/kit/feather_small.png" alt="Apache Logo" style="height:20px;"><span class="caret"></span></a>
+ <ul class="dropdown-menu dropdown-menu-right">
+ <li><a href="http://www.apache.org/">ASF Homepage</a></li>
+ <li><a href="http://www.apache.org/licenses/">License</a></li>
+ <li><a href="http://www.apache.org/security/">Security</a></li>
+ <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+ <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+ <li><a href="https://www.apache.org/foundation/policies/conduct">Code of Conduct</a></li>
+ </ul>
+ </li>
+ <li>
+ <!--
+ data-proofer-ignore disables link checking from website test automation.
+ GitHub links will not resolve until the markdown source is available on the master branch.
+ New pages would fail validation during development / PR test automation.
+ -->
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/query-syntax.md" data-proofer-ignore>
+ <i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
+ </a>
+ </li>
+ </ul>
+ </div>
+</nav>
+
+ <div class="clearfix container-main-content">
+ <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
+ <span class="section-nav-back glyphicon glyphicon-menu-left"></span>
+ <nav>
+ <ul class="section-nav-list" data-section-nav>
+ <!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+
+<li><span class="section-nav-list-main-title">Languages</span></li>
+
+<li>
+ <span class="section-nav-list-title">Java</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/sdks/java/">Java SDK overview</a></li>
+ <li><a href="https://beam.apache.org/releases/javadoc/2.16.0/" target="_blank">Java SDK API reference <img src="/images/external-link-icon.png"
+ width="14" height="14"
+ alt="External link."></a>
+ </li>
+ <li><a href="/documentation/sdks/java-dependencies/">Java SDK dependencies</a></li>
+ <li><a href="/documentation/sdks/java-extensions/">Java SDK extensions</a></li>
+ <li><a href="/documentation/sdks/java-thirdparty/">Java 3rd party extensions</a></li>
+ <li><a href="/documentation/sdks/java/testing/nexmark/">Nexmark benchmark suite</a></li>
+ </ul>
+</li>
+
+<li>
+ <span class="section-nav-list-title">Python</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/sdks/python/">Python SDK overview</a></li>
+ <li><a href="https://beam.apache.org/releases/pydoc/2.16.0/" target="_blank">Python SDK API reference <img src="/images/external-link-icon.png"
+ width="14" height="14"
+ alt="External link."></a>
+ </li>
+ <li><a href="/documentation/sdks/python-dependencies/">Python SDK dependencies</a></li>
+ <li><a href="/documentation/sdks/python-streaming/">Python streaming pipelines</a></li>
+ <li><a href="/documentation/sdks/python-type-safety/">Ensuring Python type safety</a></li>
+ <li><a href="/documentation/sdks/python-pipeline-dependencies/">Managing pipeline dependencies</a></li>
+ </ul>
+</li>
+
+<li>
+ <span class="section-nav-list-title">Go</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/sdks/go/">Go SDK overview</a></li>
+ <li><a href="https://godoc.org/github.com/apache/beam/sdks/go/pkg/beam" target="_blank">Go SDK API reference <img src="/images/external-link-icon.png"
+ width="14" height="14"
+ alt="External link."></a>
+ </li>
+ </ul>
+</li>
+
+<li>
+ <span class="section-nav-list-title">SQL</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/overview/">Overview</a></li>
+ <li><a href="/documentation/dsls/sql/walkthrough/">Walkthrough</a></li>
+ <li><a href="/documentation/dsls/sql/shell/">Shell</a></li>
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Apache Calcite dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/calcite/overview/">Calcite support overview</a></li>
+ <li><a href="/documentation/dsls/sql/calcite/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/calcite/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/calcite/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/calcite/scalar-functions/">Scalar functions</a></li>
+ <li><a href="/documentation/dsls/sql/calcite/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Beam SQL extensions</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/extensions/create-external-table/">CREATE EXTERNAL TABLE</a></li>
+ <li><a href="/documentation/dsls/sql/extensions/windowing-and-triggering/">Windowing & triggering</a></li>
+ <li><a href="/documentation/dsls/sql/extensions/joins/">Joins</a></li>
+ <li><a href="/documentation/dsls/sql/extensions/user-defined-functions/">User-defined functions</a></li>
+ <li><a href="/documentation/dsls/sql/extensions/set/">SET pipeline options</a></li>
+ </ul>
+ </li>
+ </ul>
+</li>
+
+ </ul>
+ </nav>
+ </div>
+
+ <nav class="page-nav clearfix" data-offset-top="90" data-offset-bottom="500">
+ <!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+
+
+
+<ul class="nav">
+ <li><a href="#sql-syntax">SQL Syntax</a></li>
+ <li><a href="#select-list">SELECT list</a>
+ <ul>
+ <li><a href="#select">SELECT *</a></li>
+ <li><a href="#select-expression">SELECT <code>expression</code></a></li>
+ <li><a href="#select-modifiers">SELECT modifiers</a></li>
+ <li><a href="#aliases">Aliases</a></li>
+ </ul>
+ </li>
+ <li><a href="#from-clause">FROM clause</a>
+ <ul>
+ <li><a href="#syntax">Syntax</a></li>
+ <li><a href="#">3>Subqueries</a></li>
+ <li><a href="#aliases_1">Aliases</a></li>
+ </ul>
+ </li>
+ <li><a href="#join-types">JOIN types</a>
+ <ul>
+ <li><a href="#syntax_1">Syntax</a></li>
+ <li><a href="#inner-join">[INNER] JOIN</a></li>
+ <li><a href="#full-outer-join">FULL [OUTER] JOIN</a></li>
+ <li><a href="#left-outer-join">LEFT [OUTER] JOIN</a></li>
+ <li><a href="#right-outer-join">RIGHT [OUTER] JOIN</a></li>
+ <li><a href="#on-clause">ON clause</a></li>
+ <li><a href="#sequences-of-joins">Sequences of JOINs</a></li>
+ </ul>
+ </li>
+ <li><a href="#where-clause">WHERE clause</a>
+ <ul>
+ <li><a href="#syntax_2">Syntax</a></li>
+ </ul>
+ </li>
+ <li><a href="#group-by-clause">GROUP BY clause</a>
+ <ul>
+ <li><a href="#syntax_3">Syntax</a></li>
+ </ul>
+ </li>
+ <li><a href="#having-clause">HAVING clause</a>
+ <ul>
+ <li><a href="#syntax_4">Syntax</a></li>
+ <li><a href="#mandatory-aggregation">Mandatory aggregation</a></li>
+ </ul>
+ </li>
+ <li><a href="#limit-clause-and-offset-clause">LIMIT clause and OFFSET clause</a>
+ <ul>
+ <li><a href="#syntax_6">Syntax</a></li>
+ </ul>
+ </li>
+ <li><a href="#with-clause">WITH clause</a></li>
+ <li><a href="#aliases_2">Aliases</a>
+ <ul>
+ <li><a href="#explicit-alias-syntax">Explicit alias syntax</a></li>
+ <li><a href="#explicit-alias-visibility">Explicit alias visibility</a></li>
+ <li><a href="#explicit-aliases-in-group-by-order-by-and-having-clauses">Explicit aliases in GROUP BY, ORDER BY, and HAVING clauses</a></li>
+ <li><a href="#ambiguous-aliases">Ambiguous aliases</a></li>
+ </ul>
+ </li>
+ <li><a href="#appendix-a-examples-with-sample-data">Appendix A: examples with sample data</a>
+ <ul>
+ <li><a href="#sample-tables">Sample tables</a></li>
+ <li><a href="#join-types_1">JOIN types</a></li>
+ <li><a href="#group-by-clause_1">GROUP BY clause</a></li>
+ <li><a href="#set-operators">Set operators</a></li>
+ </ul>
+ </li>
+</ul>
+
+
+ </nav>
+
+ <div class="body__contained body__section-nav">
+ <!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<h1 id="beam-zetasql-query-syntax">Beam ZetaSQL query syntax</h1>
+
+<p>Query statements scan one or more tables, streams, or expressions and return
+ the computed result rows.</p>
+
+<h2 id="sql-syntax">SQL Syntax</h2>
+
+<pre>
+<span class="var">query_statement</span>:
+ <span class="var">query_expr</span>
+
+<span class="var">query_expr</span>:
+ [ <a href="#with-clause">WITH</a> <span class="var"><a href="#with_query_name">with_query_name</a></span> AS ( <span class="var">query_expr</span> ) [, ...] ]
+ { <span class="var">select</span> | ( <span class="var">query_expr</span> ) | <span class="var">query_expr</span> <span class="var">set_op</span> <span class="var">query_expr</span> }
+ [ [ <a href="#order-by-clause">ORDER</a> BY <span class="var">expression</span> [{ ASC | DESC }] [, ...] ] <a href="#limit-clause-and-offset-clause">LIMIT</a> <span class="var">count</span> [ OFFSET <span class="var">skip_rows</span> ] ]
+
+<span class="var">select</span>:
+ <a href="#select-list">SELECT</a> [ ALL | DISTINCT ] { * | <span class="var">expression</span> [ [ AS ] <span class="var">alias</span> ] } [, ...]
+ [ <a href="#from-clause">FROM</a> <span class="var">from_item</span> ]
+ [ <a href="#where-clause">WHERE</a> <span class="var">bool_expression</span> ]
+ [ <a href="#group-by-clause">GROUP</a> BY <span class="var">expression</span> [, ...] ]
+ [ <a href="#having-clause">HAVING</a> <span class="var">bool_expression</span> ]
+
+<span class="var">set_op</span>:
+ <a href="#union">UNION</a> { ALL | DISTINCT } | <a href="#intersect">INTERSECT</a> { ALL | DISTINCT } | <a href="#except">EXCEPT</a> { ALL | DISTINCT }
+
+<span class="var">from_item</span>: {
+ <span class="var">table_name</span> [ [ AS ] <span class="var">alias</span> ] |
+ <span class="var">join</span> |
+ ( <span class="var">query_expr</span> ) [ [ AS ] <span class="var">alias</span> ] |
+ <span class="var"><a href="#with_query_name">with_query_name</a></span> [ [ AS ] <span class="var">alias</span> ]
+}
+<span class="var">table_name</span>:
+ <a href="/documentation/dsls/sql/zetasql/lexical#identifiers"><span class="var">identifier</span></a> [ . <a href="/documentation/dsls/sql/zetasql/lexical#identifiers"><span class="var">identifier</span></a> ...]
+
+<span class="var">join</span>:
+ <span class="var">from_item</span> [ <span class="var">join_type</span> ] <a href="#join-types">JOIN</a> <span class="var">from_item</span>
+ <a href="#on-clause">ON</a> <span class="var">bool_expression</span>
+
+<span class="var">join_type</span>:
+ { <a href="#inner-join">INNER</a> | <a href="#full-outer-join">FULL [OUTER]</a> | <a href="#left-outer-join">LEFT [OUTER]</a> | <a href="#right-outer-join">RIGHT [OUTER]</a> }
+
+</pre>
+
+<p>Notation:</p>
+
+<ul>
+<li>Square brackets "[ ]" indicate optional clauses.</li>
+<li>Parentheses "( )" indicate literal parentheses.</li>
+<li>The vertical bar "|" indicates a logical OR.</li>
+<li>Curly braces "{ }" enclose a set of options.</li>
+<li>A comma followed by an ellipsis within square brackets "[, ... ]" indicates that
+ the preceding item can repeat in a comma-separated list.</li>
+</ul>
+
+<h2 id="select-list">SELECT list</h2>
+
+<p>Syntax:</p>
+
+<pre>
+SELECT [ ALL ]
+ { * | <span class="var">expression</span> [ [ AS ] <span class="var">alias</span> ] } [, ...]
+</pre>
+
+<p>The <code>SELECT</code> list defines the columns that the query will return. Expressions in
+the <code>SELECT</code> list can refer to columns in any of the <code>from_item</code>s in its
+corresponding <code>FROM</code> clause.</p>
+
+<p>Each item in the <code>SELECT</code> list is one of:</p>
+
+<ul>
+<li>*</li>
+<li><code>expression</code></li>
+</ul>
+
+<h3 id="select">SELECT *</h3>
+
+<p><code>SELECT *</code>, often referred to as <em>select star</em>, produces one output column for
+each column that is visible after executing the full query.</p>
+
+<pre class="codehilite"><code>SELECT * FROM (SELECT "apple" AS fruit, "carrot" AS vegetable);
+
++-------+-----------+
+| fruit | vegetable |
++-------+-----------+
+| apple | carrot |
++-------+-----------+</code></pre>
+
+<h3 id="select-expression">SELECT <code>expression</code></h3>
+<p><strong>Caution:</strong> In the top-level
+ <code>SELECT</code>, you must either use an explicitly selected column name,
+ or if you are using an expression, you must use an explicit alias.</p>
+
+<p>Items in a <code>SELECT</code> list can be expressions. These expressions evaluate to a
+single value and produce one output column, with an optional explicit <code>alias</code>.</p>
+
+<p>If the expression does not have an explicit alias, it receives an implicit alias
+according to the rules for implicit aliases, if possible.
+Otherwise, the column is anonymous and you cannot refer to it by name elsewhere
+in the query.</p>
+
+<h3 id="select-modifiers">SELECT modifiers</h3>
+
+<p>You can modify the results returned from a <code>SELECT</code> query, as follows.</p>
+
+<h4 id="select-all">SELECT ALL</h4>
+
+<p>A <code>SELECT ALL</code> statement returns all rows, including duplicate rows.
+<code>SELECT ALL</code> is the default behavior of <code>SELECT</code>.</p>
+
+<h3 id="aliases">Aliases</h3>
+
+<p>See <a href="#using_aliases">Aliases</a> for information on syntax and visibility for
+<code>SELECT</code> list aliases.</p>
+
+<h2 id="from-clause">FROM clause</h2>
+
+<p>The <code>FROM</code> clause indicates the tables or streams from which to retrieve rows, and
+specifies how to join those rows together to produce a single stream of
+rows for processing in the rest of the query.</p>
+
+<h3 id="syntax">Syntax</h3>
+
+<pre>
+<span class="var">from_item</span>: {
+ <span class="var">table_name</span> [ [ AS ] <span class="var">alias</span> ] |
+ <span class="var">join</span> |
+ ( <span class="var">query_expr</span> ) [ [ AS ] <span class="var">alias</span> ] |
+ <span class="var"><a href="#with_query_name">with_query_name</a></span> [ [ AS ] <span class="var">alias</span> ]
+}
+</pre>
+
+<h4 id="table_name">table_name</h4>
+
+<p>The fully-qualified SQL name of a data source queryable by Beam
+ SQL, specified by a dot-separated list of identifiers using
+ <a href="/documentation/dsls/sql/zetasql/lexical">Standard SQL lexical structure</a>. You
+ must use backticks to enclose identifiers that contain characters which
+ are not letters, numbers, or underscores.</p>
+
+<pre>
+SELECT * FROM bigquery.table.`my-project`.baseball.roster;
+SELECT * FROM pubsub.topic.`my-project`.incoming_events;
+</pre>
+
+<h4 id="join">join</h4>
+
+<p>See <a href="#join_types">JOIN Types</a> below.</p>
+
+<h4 id="select_1">select</h4>
+
+<p><code>( select ) [ [ AS ] alias ]</code> is a table <a href="#subqueries">subquery</a>.</p>
+
+<h4 id="with_query_name">with_query_name</h4>
+
+<p>The query names in a <code>WITH</code> clause (see <a href="#with_clause">WITH Clause</a>) act like names of temporary tables that you
+can reference anywhere in the <code>FROM</code> clause. In the example below,
+<code>subQ1</code> and <code>subQ2</code> are <code>with_query_names</code>.</p>
+
+<p>Example:</p>
+
+<pre>
+WITH
+ subQ1 AS (SELECT * FROM Roster WHERE SchoolID = 52),
+ subQ2 AS (SELECT SchoolID FROM subQ1)
+SELECT DISTINCT * FROM subQ2;
+</pre>
+
+<p>The <code>WITH</code> clause hides any permanent tables with the same name
+for the duration of the query, unless you qualify the table name, e.g.
+
+ <code>db.Roster</code>.
+
+</p>
+
+<p><a id="subqueries"></a></p>
+
+<h3>Subqueries</h3>
+
+<p>A subquery is a query that appears inside another statement, and is written
+inside parentheses. These are also referred to as "sub-SELECTs" or
+"nested SELECTs". The full <code>SELECT</code> syntax is valid in
+subqueries.</p>
+
+<p>There are two types of subquery:</p>
+
+<ul>
+<li>Expression subqueries,
+ which you can use in a query wherever expressions are valid. Expression
+ subqueries return a single value.</li>
+<li>Table subqueries, which you can use only in a <code>FROM</code> clause. The outer
+query treats the result of the subquery as a table.</li>
+</ul>
+
+<p>Note that there must be parentheses around both types of subqueries.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT AVG ( PointsScored )
+FROM
+( SELECT PointsScored
+ FROM Stats
+ WHERE SchoolID = 77 )</code></pre>
+
+<p>Optionally, a table subquery can have an alias.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT r.LastName
+FROM
+( SELECT * FROM Roster) AS r;</code></pre>
+
+<h3 id="aliases_1">Aliases</h3>
+
+<p>See <a href="#using_aliases">Aliases</a> for information on syntax and visibility for
+<code>FROM</code> clause aliases.</p>
+
+<p><a id="join_types"></a></p>
+
+<h2 id="join-types">JOIN types</h2>
+
+<h3 id="syntax_1">Syntax</h3>
+
+<pre>
+<span class="var">join</span>:
+ <span class="var">from_item</span> [ <span class="var">join_type</span> ] JOIN <span class="var">from_item</span>
+ <a href="#on-clause">ON</a> <span class="var">bool_expression</span>
+
+<span class="var">join_type</span>:
+ { <a href="#inner-join">INNER</a> | <a href="#full-outer-join">FULL [OUTER]</a> | <a href="#left-outer-join">LEFT [OUTER]</a> | <a href="#right-outer-join">RIGHT [OUTER]</a> }
+</pre>
+
+<p>The <code>JOIN</code> clause merges two <code>from_item</code>s so that the <code>SELECT</code> clause can
+query them as one source. The <code>join_type</code> and <code>ON</code> clause (a
+"join condition") specify how to combine and discard rows from the two
+<code>from_item</code>s to form a single source.</p>
+
+<p>All <code>JOIN</code> clauses require a <code>join_type</code>.</p>
+
+<aside class="caution"> <strong>Caution:</strong> <p>Currently, only equi-join
+is supported. Joins must use the following form:</p>
+
+<pre>
+<span class="var">join condition</span>: conjunction_clause [AND ...]
+<span class="var">conjunction_clause</span>: { column | field_access } = { column | field_access }
+</pre>
+</aside>
+
+<h3 id="inner-join">[INNER] JOIN</h3>
+
+<p>An <code>INNER JOIN</code>, or simply <code>JOIN</code>, effectively calculates the Cartesian product
+of the two <code>from_item</code>s and discards all rows that do not meet the join
+condition. "Effectively" means that it is possible to implement an <code>INNER JOIN</code>
+without actually calculating the Cartesian product.</p>
+
+<h3 id="full-outer-join">FULL [OUTER] JOIN</h3>
+
+<p>A <code>FULL OUTER JOIN</code> (or simply <code>FULL JOIN</code>) returns all fields for all rows in
+both <code>from_item</code>s that meet the join condition.</p>
+
+<p><code>FULL</code> indicates that <em>all rows</em> from both <code>from_item</code>s are
+returned, even if they do not meet the join condition.</p>
+
+<p><code>OUTER</code> indicates that if a given row from one <code>from_item</code> does not
+join to any row in the other <code>from_item</code>, the row will return with NULLs
+for all columns from the other <code>from_item</code>.</p>
+
+<h3 id="left-outer-join">LEFT [OUTER] JOIN</h3>
+
+<p>The result of a <code>LEFT OUTER JOIN</code> (or simply <code>LEFT JOIN</code>) for two
+<code>from_item</code>s always retains all rows of the left <code>from_item</code> in the
+<code>JOIN</code> clause, even if no rows in the right <code>from_item</code> satisfy the join
+predicate.</p>
+
+<p><code>LEFT</code> indicates that all rows from the <em>left</em> <code>from_item</code> are
+returned; if a given row from the left <code>from_item</code> does not join to any row
+in the <em>right</em> <code>from_item</code>, the row will return with NULLs for all
+columns from the right <code>from_item</code>. Rows from the right <code>from_item</code> that
+do not join to any row in the left <code>from_item</code> are discarded.</p>
+
+<h3 id="right-outer-join">RIGHT [OUTER] JOIN</h3>
+
+<p>The result of a <code>RIGHT OUTER JOIN</code> (or simply <code>RIGHT JOIN</code>) is similar and
+symmetric to that of <code>LEFT OUTER JOIN</code>.</p>
+
+<p><a id="on_clause"></a></p>
+
+<h3 id="on-clause">ON clause</h3>
+
+<p>The <code>ON</code> clause contains a <code>bool_expression</code>. A combined row (the result of
+joining two rows) meets the join condition if <code>bool_expression</code> returns
+TRUE.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT * FROM Roster INNER JOIN PlayerStats
+ON Roster.LastName = PlayerStats.LastName;</code></pre>
+
+<p><a id="sequences_of_joins"></a></p>
+
+<h3 id="sequences-of-joins">Sequences of JOINs</h3>
+
+<p>The <code>FROM</code> clause can contain multiple <code>JOIN</code> clauses in sequence.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT * FROM a LEFT JOIN b ON TRUE LEFT JOIN c ON TRUE;</code></pre>
+
+<p>where <code>a</code>, <code>b</code>, and <code>c</code> are any <code>from_item</code>s. JOINs are bound from left to
+right, but you can insert parentheses to group them in a different order.</p>
+
+<p><a id="where_clause"></a></p>
+
+<h2 id="where-clause">WHERE clause</h2>
+
+<h3 id="syntax_2">Syntax</h3>
+
+<pre class="codehilite"><code>WHERE bool_expression</code></pre>
+
+<p>The <code>WHERE</code> clause filters out rows by evaluating each row against
+<code>bool_expression</code>, and discards all rows that do not return TRUE (that is,
+rows that return FALSE or NULL).</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT * FROM Roster
+WHERE SchoolID = 52;</code></pre>
+
+<p>The <code>bool_expression</code> can contain multiple sub-conditions.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT * FROM Roster
+WHERE STARTS_WITH(LastName, "Mc") OR STARTS_WITH(LastName, "Mac");</code></pre>
+
+<p>You cannot reference column aliases from the <code>SELECT</code> list in the <code>WHERE</code>
+clause.</p>
+
+<p><a id="group_by_clause"></a></p>
+
+<h2 id="group-by-clause">GROUP BY clause</h2>
+
+<h3 id="syntax_3">Syntax</h3>
+
+<pre>
+GROUP BY <span class="var">expression</span> [, ...]
+</pre>
+
+<p>The <code>GROUP BY</code> clause groups together rows in a table with non-distinct values
+for the <code>expression</code> in the <code>GROUP BY</code> clause. For multiple rows in the
+source table with non-distinct values for <code>expression</code>, the
+<code>GROUP BY</code> clause produces a single combined row. <code>GROUP BY</code> is commonly used
+when aggregate functions are present in the <code>SELECT</code> list, or to eliminate
+redundancy in the output. The data type of <code>expression</code> must be <a href="/documentation/dsls/sql/zetasql/data-types#data-type-properties">groupable</a>.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT SUM(PointsScored), LastName
+FROM PlayerStats
+GROUP BY LastName;</code></pre>
+
+<p>The <code>GROUP BY</code> clause can refer to expression names in the <code>SELECT</code> list. The
+<code>GROUP BY</code> clause also allows ordinal references to expressions in the <code>SELECT</code>
+list using integer values. <code>1</code> refers to the first expression in the
+<code>SELECT</code> list, <code>2</code> the second, and so forth. The expression list can combine
+ordinals and expression names.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT SUM(PointsScored), LastName, FirstName
+FROM PlayerStats
+GROUP BY LastName, FirstName;</code></pre>
+
+<p>The query above is equivalent to:</p>
+
+<pre class="codehilite"><code>SELECT SUM(PointsScored), LastName, FirstName
+FROM PlayerStats
+GROUP BY 2, FirstName;</code></pre>
+
+<p><code>GROUP BY</code> clauses may also refer to aliases. If a query contains aliases in
+the <code>SELECT</code> clause, those aliases override names in the corresponding <code>FROM</code>
+clause.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT SUM(PointsScored), LastName as last_name
+FROM PlayerStats
+GROUP BY last_name;</code></pre>
+
+<p><a id="having_clause"></a></p>
+
+<h2 id="having-clause">HAVING clause</h2>
+
+<h3 id="syntax_4">Syntax</h3>
+
+<pre class="codehilite"><code>HAVING bool_expression</code></pre>
+
+<p>The <code>HAVING</code> clause is similar to the <code>WHERE</code> clause: it filters out rows that
+do not return TRUE when they are evaluated against the <code>bool_expression</code>.</p>
+
+<p>As with the <code>WHERE</code> clause, the <code>bool_expression</code> can be any expression
+that returns a boolean, and can contain multiple sub-conditions.</p>
+
+<p>The <code>HAVING</code> clause differs from the <code>WHERE</code> clause in that:</p>
+
+<ul>
+<li>The <code>HAVING</code> clause requires <code>GROUP BY</code> or aggregation to be present in the
+ query.</li>
+<li>The <code>HAVING</code> clause occurs after <code>GROUP BY</code> and aggregation, and before
+ <code>ORDER BY</code>. This means that the <code>HAVING</code> clause is evaluated once for every
+ aggregated row in the result set. This differs from the <code>WHERE</code> clause,
+ which is evaluated before <code>GROUP BY</code> and aggregation.</li>
+</ul>
+
+<p>The <code>HAVING</code> clause can reference columns available via the <code>FROM</code> clause, as
+well as <code>SELECT</code> list aliases. Expressions referenced in the <code>HAVING</code> clause
+must either appear in the <code>GROUP BY</code> clause or they must be the result of an
+aggregate function:</p>
+
+<pre class="codehilite"><code>SELECT LastName
+FROM Roster
+GROUP BY LastName
+HAVING SUM(PointsScored) > 15;</code></pre>
+
+<p>If a query contains aliases in the <code>SELECT</code> clause, those aliases override names
+in a <code>FROM</code> clause.</p>
+
+<pre class="codehilite"><code>SELECT LastName, SUM(PointsScored) AS ps
+FROM Roster
+GROUP BY LastName
+HAVING ps > 0;</code></pre>
+
+<p><a id="mandatory_aggregation"></a></p>
+
+<h3 id="mandatory-aggregation">Mandatory aggregation</h3>
+
+<p>Aggregation does not have to be present in the <code>HAVING</code> clause itself, but
+aggregation must be present in at least one of the following forms:</p>
+
+<h4 id="aggregation-function-in-the-select-list">Aggregation function in the <code>SELECT</code> list.</h4>
+
+<pre class="codehilite"><code>SELECT LastName, SUM(PointsScored) AS total
+FROM PlayerStats
+GROUP BY LastName
+HAVING total > 15;</code></pre>
+
+<h4 id="aggregation-function-in-the-having-clause">Aggregation function in the 'HAVING' clause.</h4>
+
+<pre class="codehilite"><code>SELECT LastName
+FROM PlayerStats
+GROUP BY LastName
+HAVING SUM(PointsScored) > 15;</code></pre>
+
+<h4 id="aggregation-in-both-the-select-list-and-having-clause">Aggregation in both the <code>SELECT</code> list and <code>HAVING</code> clause.</h4>
+
+<p>When aggregation functions are present in both the <code>SELECT</code> list and <code>HAVING</code>
+clause, the aggregation functions and the columns they reference do not need
+to be the same. In the example below, the two aggregation functions,
+<code>COUNT()</code> and <code>SUM()</code>, are different and also use different columns.</p>
+
+<pre class="codehilite"><code>SELECT LastName, COUNT(*)
+FROM PlayerStats
+GROUP BY LastName
+HAVING SUM(PointsScored) > 15;</code></pre>
+
+<p><a id="limit-clause_and_offset_clause"></a></p>
+
+<h2 id="limit-clause-and-offset-clause">LIMIT clause and OFFSET clause</h2>
+
+<h3 id="syntax_6">Syntax</h3>
+
+<pre class="codehilite"><code>[ ORDER BY expression [{ASC | DESC}] [,...] ] LIMIT count [ OFFSET skip_rows ]</code></pre>
+
+<p>The <code>ORDER BY</code> clause specifies a column or expression as the sort criterion for
+the result set. If an ORDER BY clause is not present, the order of the results
+of a query is not defined. The default sort direction is <code>ASC</code>, which sorts the
+results in ascending order of <code>expression</code> values. <code>DESC</code> sorts the results in
+descending order. Column aliases from a <code>FROM</code> clause or <code>SELECT</code> list are
+allowed. If a query contains aliases in the <code>SELECT</code> clause, those aliases
+override names in the corresponding <code>FROM</code> clause.</p>
+
+<p>It is possible to order by multiple columns.</p>
+
+<p>The following rules apply when ordering values:</p>
+
+<ul>
+<li>NULLs: In the context of the <code>ORDER BY</code> clause, NULLs are the minimum
+ possible value; that is, NULLs appear first in <code>ASC</code> sorts and last in <code>DESC</code>
+ sorts.</li>
+</ul>
+
+<p><code>LIMIT</code> specifies a non-negative <code>count</code> of type INT64,
+and no more than <code>count</code> rows will be returned. <code>LIMIT</code> <code>0</code> returns 0 rows. If
+there is a set
+operation, <code>LIMIT</code> is applied after the
+set operation
+is evaluated.</p>
+
+<p><code>OFFSET</code> specifies a non-negative <code>skip_rows</code> of type
+INT64, and only rows from
+that offset in the table will be considered.</p>
+
+<p>These clauses accept only literal or parameter values.</p>
+
+<p>The rows that are returned by <code>LIMIT</code> and <code>OFFSET</code> is unspecified unless these
+operators are used after <code>ORDER BY</code>.</p>
+
+<p><a id="with_clause"></a></p>
+
+<h2 id="with-clause">WITH clause</h2>
+
+<p>The <code>WITH</code> clause binds the results of one or more named subqueries to temporary
+table names. Each introduced table name is visible in subsequent <code>SELECT</code>
+expressions within the same query expression. This includes the following kinds
+of <code>SELECT</code> expressions:</p>
+
+<ul>
+<li>Any <code>SELECT</code> expressions in subsequent <code>WITH</code> bindings</li>
+<li>Top level <code>SELECT</code> expressions in the query expression on both sides of a set
+ operator such as <code>UNION</code></li>
+<li><code>SELECT</code> expressions inside subqueries within the same query expression</li>
+</ul>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>WITH subQ1 AS (SELECT SchoolID FROM Roster),
+ subQ2 AS (SELECT OpponentID FROM PlayerStats)
+SELECT * FROM subQ1
+UNION ALL
+SELECT * FROM subQ2;</code></pre>
+
+<p>The following are scoping rules for <code>WITH</code> clauses:</p>
+
+<ul>
+<li>Aliases are scoped so that the aliases introduced in a <code>WITH</code> clause are
+ visible only in the later subqueries in the same <code>WITH</code> clause, and in the
+ query under the <code>WITH</code> clause.</li>
+<li>Aliases introduced in the same <code>WITH</code> clause must be unique, but the same
+ alias can be used in multiple <code>WITH</code> clauses in the same query. The local
+ alias overrides any outer aliases anywhere that the local alias is visible.</li>
+</ul>
+
+<p>Beam SQL does not support <code>WITH RECURSIVE</code>.</p>
+
+<p><a name="using_aliases"></a></p>
+
+<h2 id="aliases_2">Aliases</h2>
+
+<p>An alias is a temporary name given to a table, column, or expression present in
+a query. You can introduce explicit aliases in the <code>SELECT</code> list or <code>FROM</code>
+clause.</p>
+
+<p><a id="explicit_alias_syntax"></a></p>
+
+<h3 id="explicit-alias-syntax">Explicit alias syntax</h3>
+
+<p>You can introduce explicit aliases in either the <code>FROM</code> clause or the <code>SELECT</code>
+list.</p>
+
+<p>In a <code>FROM</code> clause, you can introduce explicit aliases for any item, including
+tables, arrays and subqueries, using <code>[AS] alias</code>. The <code>AS</code>
+keyword is optional.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT s.FirstName, s2.SongName
+FROM Singers AS s, (SELECT * FROM Songs) AS s2;</code></pre>
+
+<p>You can introduce explicit aliases for any expression in the <code>SELECT</code> list using
+<code>[AS] alias</code>. The <code>AS</code> keyword is optional.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT s.FirstName AS name, LOWER(s.FirstName) AS lname
+FROM Singers s;</code></pre>
+
+<p><a id="alias_visibility"></a></p>
+
+<h3 id="explicit-alias-visibility">Explicit alias visibility</h3>
+
+<p>After you introduce an explicit alias in a query, there are restrictions on
+where else in the query you can reference that alias. These restrictions on
+alias visibility are the result of Beam SQL's name scoping rules.</p>
+
+<p><a id="from_clause_aliases"></a></p>
+
+<h4 id="from-clause-aliases">FROM clause aliases</h4>
+
+<p>Beam SQL processes aliases in a <code>FROM</code> clause from left to right,
+and aliases are visible only to subsequent path expressions in a <code>FROM</code>
+clause.</p>
+
+<p>Example:</p>
+
+<p>Assume the <code>Singers</code> table had a <code>Concerts</code> column of <code>ARRAY</code> type.</p>
+
+<pre class="codehilite"><code>SELECT FirstName
+FROM Singers AS s, s.Concerts;</code></pre>
+
+<p>Invalid:</p>
+
+<pre class="codehilite"><code>SELECT FirstName
+FROM s.Concerts, Singers AS s; // INVALID.</code></pre>
+
+<p><code>FROM</code> clause aliases are <strong>not</strong> visible to subqueries in the same <code>FROM</code>
+clause. Subqueries in a <code>FROM</code> clause cannot contain correlated references to
+other tables in the same <code>FROM</code> clause.</p>
+
+<p>Invalid:</p>
+
+<pre class="codehilite"><code>SELECT FirstName
+FROM Singers AS s, (SELECT (2020 - ReleaseDate) FROM s) // INVALID.</code></pre>
+
+<p>You can use any column name from a table in the <code>FROM</code> as an alias anywhere in
+the query, with or without qualification with the table name.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT FirstName, s.ReleaseDate
+FROM Singers s WHERE ReleaseDate = 1975;</code></pre>
+
+<p><a id="select-list_aliases"></a></p>
+
+<h4 id="select-list-aliases">SELECT list aliases</h4>
+
+<p>Aliases in the <code>SELECT</code> list are <strong>visible only</strong> to the following clauses:</p>
+
+<ul>
+<li><code>GROUP BY</code> clause</li>
+<li><code>ORDER BY</code> clause</li>
+<li><code>HAVING</code> clause</li>
+</ul>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT LastName AS last, SingerID
+FROM Singers
+ORDER BY last;</code></pre>
+
+<p><a id="aliases_clauses"></a></p>
+
+<h3 id="explicit-aliases-in-group-by-order-by-and-having-clauses">Explicit aliases in GROUP BY, ORDER BY, and HAVING clauses</h3>
+
+<p>These three clauses, <code>GROUP BY</code>, <code>ORDER BY</code>, and <code>HAVING</code>, can refer to only the
+following values:</p>
+
+<ul>
+<li>Tables in the <code>FROM</code> clause and any of their columns.</li>
+<li>Aliases from the <code>SELECT</code> list.</li>
+</ul>
+
+<p><code>GROUP BY</code> and <code>ORDER BY</code> can also refer to a third group:</p>
+
+<ul>
+<li>Integer literals, which refer to items in the <code>SELECT</code> list. The integer <code>1</code>
+ refers to the first item in the <code>SELECT</code> list, <code>2</code> refers to the second item,
+ etc.</li>
+</ul>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT SingerID AS sid, COUNT(Songid) AS s2id
+FROM Songs
+GROUP BY 1
+ORDER BY 2 DESC LIMIT 10;</code></pre>
+
+<p>The query above is equivalent to:</p>
+
+<pre class="codehilite"><code>SELECT SingerID AS sid, COUNT(Songid) AS s2id
+FROM Songs
+GROUP BY sid
+ORDER BY s2id DESC LIMIT 10;</code></pre>
+
+<p><a id="ambiguous_aliases"></a></p>
+
+<h3 id="ambiguous-aliases">Ambiguous aliases</h3>
+
+<p>Beam SQL provides an error if a name is ambiguous, meaning it can
+resolve to more than one unique object.</p>
+
+<p>Examples:</p>
+
+<p>This query contains column names that conflict between tables, since both
+<code>Singers</code> and <code>Songs</code> have a column named <code>SingerID</code>:</p>
+
+<pre class="codehilite"><code>SELECT SingerID
+FROM Singers, Songs;</code></pre>
+
+<p>This query contains aliases that are ambiguous in the <code>GROUP BY</code> clause because
+they are duplicated in the <code>SELECT</code> list:</p>
+
+<pre class="codehilite"><code>SELECT FirstName AS name, LastName AS name,
+FROM Singers
+GROUP BY name;</code></pre>
+
+<p>Ambiguity between a <code>FROM</code> clause column name and a <code>SELECT</code> list alias in
+<code>GROUP BY</code>:</p>
+
+<pre class="codehilite"><code>SELECT UPPER(LastName) AS LastName
+FROM Singers
+GROUP BY LastName;</code></pre>
+
+<p>The query above is ambiguous and will produce an error because <code>LastName</code> in the
+<code>GROUP BY</code> clause could refer to the original column <code>LastName</code> in <code>Singers</code>, or
+it could refer to the alias <code>AS LastName</code>, whose value is <code>UPPER(LastName)</code>.</p>
+
+<p>The same rules for ambiguity apply to path expressions. Consider the following
+query where <code>table</code> has columns <code>x</code> and <code>y</code>, and column <code>z</code> is of type STRUCT
+and has fields <code>v</code>, <code>w</code>, and <code>x</code>.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT x, z AS T
+FROM table T
+GROUP BY T.x;</code></pre>
+
+<p>The alias <code>T</code> is ambiguous and will produce an error because <code>T.x</code> in the <code>GROUP
+BY</code> clause could refer to either <code>table.x</code> or <code>table.z.x</code>.</p>
+
+<p>A name is <strong>not</strong> ambiguous in <code>GROUP BY</code>, <code>ORDER BY</code> or <code>HAVING</code> if it is both
+a column name and a <code>SELECT</code> list alias, as long as the name resolves to the
+same underlying object.</p>
+
+<p>Example:</p>
+
+<pre class="codehilite"><code>SELECT LastName, BirthYear AS BirthYear
+FROM Singers
+GROUP BY BirthYear;</code></pre>
+
+<p>The alias <code>BirthYear</code> is not ambiguous because it resolves to the same
+underlying column, <code>Singers.BirthYear</code>.</p>
+
+<p><a id="appendix_a_examples_with_sample_data"></a></p>
+<h2 id="appendix-a-examples-with-sample-data">Appendix A: examples with sample data</h2>
+<p><a id="sample_tables"></a></p>
+<h3 id="sample-tables">Sample tables</h3>
+<p>The following three tables contain sample data about athletes, their schools,
+and the points they score during the season. These tables will be used to
+illustrate the behavior of different query clauses.</p>
+<p>Table Roster:</p>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+<th>SchoolID</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Adams</td>
+<td>50</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>52</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+<td>52</td>
+</tr>
+<tr>
+<td>Davis</td>
+<td>51</td>
+</tr>
+<tr>
+<td>Eisenhower</td>
+<td>77</td>
+</tr>
+</tbody>
+</table>
+<p>The Roster table includes a list of player names (LastName) and the unique ID
+assigned to their school (SchoolID).</p>
+<p>Table PlayerStats:</p>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+<th>OpponentID</th>
+<th>PointsScored</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Adams</td>
+<td>51</td>
+<td>3</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>77</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+<td>77</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Adams</td>
+<td>52</td>
+<td>4</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>50</td>
+<td>13</td>
+</tr>
+</tbody>
+</table>
+<p>The PlayerStats table includes a list of player names (LastName) and the unique
+ID assigned to the opponent they played in a given game (OpponentID) and the
+number of points scored by the athlete in that game (PointsScored).</p>
+<p>Table TeamMascot:</p>
+<table class="table">
+<thead>
+<tr>
+<th>SchoolId</th>
+<th>Mascot</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>50</td>
+<td>Jaguars</td>
+</tr>
+<tr>
+<td>51</td>
+<td>Knights</td>
+</tr>
+<tr>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>53</td>
+<td>Mustangs</td>
+</tr>
+</tbody>
+</table>
+<p>The TeamMascot table includes a list of unique school IDs (SchoolID) and the
+mascot for that school (Mascot).</p>
+<p><a id="join_types_examples"></a></p>
+<h3 id="join-types_1">JOIN types</h3>
+<p>1) [INNER] JOIN</p>
+<p>Example:</p>
+<pre class="codehilite"><code>SELECT * FROM Roster JOIN TeamMascot
+ON Roster.SchoolID = TeamMascot.SchoolID;</code></pre>
+<p>Results:</p>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+<th>Roster.SchoolId</th>
+<th>TeamMascot.SchoolId</th>
+<th>Mascot</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Adams</td>
+<td>50</td>
+<td>50</td>
+<td>Jaguars</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>52</td>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+<td>52</td>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>Davis</td>
+<td>51</td>
+<td>51</td>
+<td>Knights</td>
+</tr>
+</tbody>
+</table>
+<p>2) FULL [OUTER] JOIN</p>
+<p>Example:</p>
+<pre class="codehilite"><code>SELECT * FROM Roster FULL JOIN TeamMascot
+ON Roster.SchoolID = TeamMascot.SchoolID;</code></pre>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+<th>Roster.SchoolId</th>
+<th>TeamMascot.SchoolId</th>
+<th>Mascot</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Adams</td>
+<td>50</td>
+<td>50</td>
+<td>Jaguars</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>52</td>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+<td>52</td>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>Davis</td>
+<td>51</td>
+<td>51</td>
+<td>Knights</td>
+</tr>
+<tr>
+<td>Eisenhower</td>
+<td>77</td>
+<td>NULL</td>
+<td>NULL</td>
+</tr>
+<tr>
+<td>NULL</td>
+<td>NULL</td>
+<td>53</td>
+<td>Mustangs</td>
+</tr>
+</tbody>
+</table>
+<p>3) LEFT [OUTER] JOIN</p>
+<p>Example:</p>
+<pre class="codehilite"><code>SELECT * FROM Roster LEFT JOIN TeamMascot
+ON Roster.SchoolID = TeamMascot.SchoolID;</code></pre>
+<p>Results:</p>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+<th>Roster.SchoolId</th>
+<th>TeamMascot.SchoolId</th>
+<th>Mascot</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Adams</td>
+<td>50</td>
+<td>50</td>
+<td>Jaguars</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>52</td>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+<td>52</td>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>Davis</td>
+<td>51</td>
+<td>51</td>
+<td>Knights</td>
+</tr>
+<tr>
+<td>Eisenhower</td>
+<td>77</td>
+<td>NULL</td>
+<td>NULL</td>
+</tr>
+</tbody>
+</table>
+<p>4) RIGHT [OUTER] JOIN</p>
+<p>Example:</p>
+<pre class="codehilite"><code>SELECT * FROM Roster RIGHT JOIN TeamMascot
+ON Roster.SchoolID = TeamMascot.SchoolID;</code></pre>
+<p>Results:</p>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+<th>Roster.SchoolId</th>
+<th>TeamMascot.SchoolId</th>
+<th>Mascot</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Adams</td>
+<td>50</td>
+<td>50</td>
+<td>Jaguars</td>
+</tr>
+<tr>
+<td>Davis</td>
+<td>51</td>
+<td>51</td>
+<td>Knights</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+<td>52</td>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>52</td>
+<td>52</td>
+<td>Lakers</td>
+</tr>
+<tr>
+<td>NULL</td>
+<td>NULL</td>
+<td>53</td>
+<td>Mustangs</td>
+</tr>
+</tbody>
+</table>
+<h3 id="group-by-clause_1">GROUP BY clause</h3>
+<p>Example:</p>
+<pre class="codehilite"><code>SELECT LastName, SUM(PointsScored)
+FROM PlayerStats
+GROUP BY LastName;</code></pre>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+<th>SUM</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Adams</td>
+<td>7</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>13</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+<td>1</td>
+</tr>
+</tbody>
+</table>
+<p><a id="set_operators"></a></p>
+<h3 id="set-operators">Set operators</h3>
+<p><a id="union"></a></p>
+<h4 id="union_1">UNION</h4>
+<p>The <code>UNION</code> operator combines the result sets of two or more <code>SELECT</code> statements
+by pairing columns from the result set of each <code>SELECT</code> statement and vertically
+concatenating them.</p>
+<p>Example:</p>
+<pre class="codehilite"><code>SELECT Mascot AS X, SchoolID AS Y
+FROM TeamMascot
+UNION ALL
+SELECT LastName, PointsScored
+FROM PlayerStats;</code></pre>
+<p>Results:</p>
+<table class="table">
+<thead>
+<tr>
+<th>X</th>
+<th>Y</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Jaguars</td>
+<td>50</td>
+</tr>
+<tr>
+<td>Knights</td>
+<td>51</td>
+</tr>
+<tr>
+<td>Lakers</td>
+<td>52</td>
+</tr>
+<tr>
+<td>Mustangs</td>
+<td>53</td>
+</tr>
+<tr>
+<td>Adams</td>
+<td>3</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Adams</td>
+<td>4</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+<td>13</td>
+</tr>
+</tbody>
+</table>
+<p><a id="intersect"></a></p>
+<h4 id="intersect_1">INTERSECT</h4>
+<p>This query returns the last names that are present in both Roster and
+PlayerStats.</p>
+<pre class="codehilite"><code>SELECT LastName
+FROM Roster
+INTERSECT ALL
+SELECT LastName
+FROM PlayerStats;</code></pre>
+<p>Results:</p>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Adams</td>
+</tr>
+<tr>
+<td>Coolidge</td>
+</tr>
+<tr>
+<td>Buchanan</td>
+</tr>
+</tbody>
+</table>
+<p><a id="except"></a></p>
+<h4 id="except_1">EXCEPT</h4>
+<p>The query below returns last names in Roster that are <strong>not </strong>present in
+PlayerStats.</p>
+<pre class="codehilite"><code>SELECT LastName
+FROM Roster
+EXCEPT DISTINCT
+SELECT LastName
+FROM PlayerStats;</code></pre>
+<p>Results:</p>
+<table class="table">
+<thead>
+<tr>
+<th>LastName</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>Eisenhower</td>
+</tr>
+<tr>
+<td>Davis</td>
+</tr>
+</tbody>
+</table>
+<p>Reversing the order of the <code>SELECT</code> statements will return last names in
+PlayerStats that are <strong>not</strong> present in Roster:</p>
+<pre class="codehilite"><code>SELECT LastName
+FROM PlayerStats
+EXCEPT DISTINCT
+SELECT LastName
+FROM Roster;</code></pre>
+<p>Results:</p>
+<pre class="codehilite"><code>(empty)</code></pre>
+
+ </div>
+ </div>
+ <!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ http://www.apache.org/licenses/LICENSE-2.0
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+
+<footer class="footer">
+ <div class="footer__contained">
+ <div class="footer__cols">
+ <div class="footer__cols__col">
+ <div class="footer__cols__col__logo">
+ <img src="/images/beam_logo_circle.svg" class="footer__logo" alt="Beam logo">
+ </div>
+ <div class="footer__cols__col__logo">
+ <img src="/images/apache_logo_circle.svg" class="footer__logo" alt="Apache logo">
+ </div>
+ </div>
+ <div class="footer__cols__col footer__cols__col--md">
+ <div class="footer__cols__col__title">Start</div>
+ <div class="footer__cols__col__link"><a href="/get-started/beam-overview/">Overview</a></div>
+ <div class="footer__cols__col__link"><a href="/get-started/quickstart-java/">Quickstart (Java)</a></div>
+ <div class="footer__cols__col__link"><a href="/get-started/quickstart-py/">Quickstart (Python)</a></div>
+ <div class="footer__cols__col__link"><a href="/get-started/quickstart-go/">Quickstart (Go)</a></div>
+ <div class="footer__cols__col__link"><a href="/get-started/downloads/">Downloads</a></div>
+ </div>
+ <div class="footer__cols__col footer__cols__col--md">
+ <div class="footer__cols__col__title">Docs</div>
+ <div class="footer__cols__col__link"><a href="/documentation/programming-guide/">Concepts</a></div>
+ <div class="footer__cols__col__link"><a href="/documentation/pipelines/design-your-pipeline/">Pipelines</a></div>
+ <div class="footer__cols__col__link"><a href="/documentation/runners/capability-matrix/">Runners</a></div>
+ </div>
+ <div class="footer__cols__col footer__cols__col--md">
+ <div class="footer__cols__col__title">Community</div>
+ <div class="footer__cols__col__link"><a href="/contribute/">Contribute</a></div>
+ <div class="footer__cols__col__link"><a href="https://projects.apache.org/committee.html?beam" target="_blank">Team<img src="/images/external-link-icon.png"
+ width="14" height="14"
+ alt="External link."></a></div>
+ <div class="footer__cols__col__link"><a href="/contribute/presentation-materials/">Media</a></div>
+ </div>
+ <div class="footer__cols__col footer__cols__col--md">
+ <div class="footer__cols__col__title">Resources</div>
+ <div class="footer__cols__col__link"><a href="/blog/">Blog</a></div>
+ <div class="footer__cols__col__link"><a href="/get-started/support/">Support</a></div>
+ <div class="footer__cols__col__link"><a href="https://github.com/apache/beam">GitHub</a></div>
+ </div>
+ </div>
+ </div>
+ <div class="footer__bottom">
+ ©
+ <a href="http://www.apache.org">The Apache Software Foundation</a>
+ | <a href="/privacy_policy">Privacy Policy</a>
+ | <a href="/feed.xml">RSS Feed</a>
+ <br><br>
+ Apache Beam, Apache, Beam, the Beam logo, and the Apache feather logo are
+ either registered trademarks or trademarks of The Apache Software
+ Foundation. All other products or name brands are trademarks of their
+ respective holders, including The Apache Software Foundation.
+ </div>
+</footer>
+
+ </body>
+</html>
diff --git a/website/generated-content/documentation/dsls/sql/extensions/create-external-table/index.html b/website/generated-content/documentation/dsls/sql/zetasql/string-functions/index.html
similarity index 51%
copy from website/generated-content/documentation/dsls/sql/extensions/create-external-table/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/string-functions/index.html
index 4b22d00..3bbf2e1 100644
--- a/website/generated-content/documentation/dsls/sql/extensions/create-external-table/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/string-functions/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL extension: CREATE EXTERNAL TABLE Statement</title>
+ <title>Beam ZetaSQL string functions</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/extensions/create-external-table/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/string-functions/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/extensions/create-external-table.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/string-functions.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -261,45 +284,17 @@
<ul class="nav">
- <li><a href="#syntax">Syntax</a></li>
- <li><a href="#bigquery">BigQuery</a>
- <ul>
- <li><a href="#syntax-1">Syntax</a></li>
- <li><a href="#read-mode">Read Mode</a></li>
- <li><a href="#write-mode">Write Mode</a></li>
- <li><a href="#schema">Schema</a></li>
- <li><a href="#example">Example</a></li>
- </ul>
- </li>
- <li><a href="#pubsub">Pub/Sub</a>
- <ul>
- <li><a href="#syntax-2">Syntax</a></li>
- <li><a href="#read-mode-1">Read Mode</a></li>
- <li><a href="#write-mode-1">Write Mode</a></li>
- <li><a href="#schema-1">Schema</a></li>
- <li><a href="#supported-payload">Supported Payload</a></li>
- <li><a href="#example-1">Example</a></li>
- </ul>
- </li>
- <li><a href="#kafka">Kafka</a>
- <ul>
- <li><a href="#syntax-3">Syntax</a></li>
- <li><a href="#read-mode-2">Read Mode</a></li>
- <li><a href="#write-mode-2">Write Mode</a></li>
- <li><a href="#supported-payload-1">Supported Payload</a></li>
- <li><a href="#schema-2">Schema</a></li>
- </ul>
- </li>
- <li><a href="#text">Text</a>
- <ul>
- <li><a href="#syntax-4">Syntax</a></li>
- <li><a href="#read-mode-3">Read Mode</a></li>
- <li><a href="#write-mode-3">Write Mode</a></li>
- <li><a href="#supported-payload-2">Supported Payload</a></li>
- <li><a href="#schema-3">Schema</a></li>
- <li><a href="#example-2">Example</a></li>
- </ul>
- </li>
+ <li><a href="#char_length">CHAR_LENGTH</a></li>
+ <li><a href="#character_length">CHARACTER_LENGTH</a></li>
+ <li><a href="#concat">CONCAT</a></li>
+ <li><a href="#ends_with">ENDS_WITH</a></li>
+ <li><a href="#ltrim">LTRIM</a></li>
+ <li><a href="#replace">REPLACE</a></li>
+ <li><a href="#reverse">REVERSE</a></li>
+ <li><a href="#rtrim">RTRIM</a></li>
+ <li><a href="#starts_with">STARTS_WITH</a></li>
+ <li><a href="#substr">SUBSTR</a></li>
+ <li><a href="#trim">TRIM</a></li>
</ul>
@@ -320,442 +315,677 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-extensions-create-external-table">Beam SQL extensions: CREATE EXTERNAL TABLE</h1>
+<h1 id="beam-zetasql-string-functions">Beam ZetaSQL string functions</h1>
-<p>Beam SQL’s <code class="highlighter-rouge">CREATE EXTERNAL TABLE</code> statement registers a virtual table that maps to an
-<a href="/documentation/io/built-in/">external storage system</a>.
-For some storage systems, <code class="highlighter-rouge">CREATE EXTERNAL TABLE</code> does not create a physical table until
-a write occurs. After the physical table exists, you can access the table with
-the <code class="highlighter-rouge">SELECT</code>, <code class="highlighter-rouge">JOIN</code>, and <code class="highlighter-rouge">INSERT INTO</code> statements.</p>
+<p>This page documents the ZetaSQL string functions supported by Beam ZetaSQL.</p>
-<p>The <code class="highlighter-rouge">CREATE EXTERNAL TABLE</code> statement includes a schema and extended clauses.</p>
+<p>These string functions work on STRING data. STRING values must be well-formed UTF-8. All string comparisons are done byte-by-byte, without regard to Unicode
+canonical equivalence.</p>
-<h2 id="syntax">Syntax</h2>
+<table class="table">
+ <thead>
+ <tr>
+ <th>Operator syntax</th>
+ <th>Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><a href="#char_length">CHAR_LENGTH(value)</a></td>
+ <td>Returns the length of the string in characters</td>
+ </tr>
+ <tr>
+ <td><a href="#character_length">CHARACTER_LENGTH(value)</a></td>
+ <td>Synonym for CHAR_LENGTH</td>
+ </tr>
+ <tr>
+ <td><a href="#concat">CONCAT(value1[, …])</a></td>
+ <td>Concatenates up to five values into a single result</td>
+ </tr>
+ <tr>
+ <td><a href="#ends_with">ENDS_WITH(value1, value2)</a></td>
+ <td>Returns TRUE if the second value is a suffix of the first</td>
+ </tr>
+ <tr>
+ <td><a href="#ltrim">LTRIM(value1[, value2])</a></td>
+ <td>Identical to TRIM, but only removes leading characters.</td>
+ </tr>
+ <tr>
+ <td><a href="#replace">REPLACE(original_value, from_value, to_value)</a></td>
+ <td>Replaces all occurrences of <code class="highlighter-rouge">from_value</code> with <code class="highlighter-rouge">to_value</code> in <code class="highlighter-rouge">original_value</code></td>
+ </tr>
+ <tr>
+ <td><a href="#reverse">REVERSE(value)</a></td>
+ <td>Returns the reverse of the input string</td>
+ </tr>
+ <tr>
+ <td><a href="#rtrim">RTRIM(value1[, value2])</a></td>
+ <td>Identical to TRIM, but only removes trailing characters</td>
+ </tr>
+ <tr>
+ <td><a href="#starts_with">STARTS_WITH(value1, value2)</a></td>
+ <td>Returns TRUE if the second value is a prefix of the first.</td>
+ </tr>
+ <tr>
+ <td><a href="#substr">SUBSTR(value, position[, length])</a></td>
+ <td>Returns a substring of the supplied value</td>
+ </tr>
+ <tr>
+ <td><a href="#trim">TRIM(value1[, value2])</a></td>
+ <td>Removes all leading and trailing characters that match <code class="highlighter-rouge">value2</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="char_length">CHAR_LENGTH</h2>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>CHAR_LENGTH(value)
+</code></pre>
+</div>
-<div class="highlighter-rouge"><pre class="highlight"><code>CREATE EXTERNAL TABLE [ IF NOT EXISTS ] tableName (tableElement [, tableElement ]*)
-TYPE type
-[LOCATION location]
-[TBLPROPERTIES tblProperties]
+<p><strong>Description</strong></p>
-simpleType: TINYINT | SMALLINT | INTEGER | BIGINT | FLOAT | DOUBLE | DECIMAL | BOOLEAN | DATE | TIME | TIMESTAMP | CHAR | VARCHAR
+<p>Returns the length of the STRING in characters.</p>
-fieldType: simpleType | MAP<simpleType, fieldType> | ARRAY<fieldType> | ROW<tableElement [, tableElement ]*>
+<p><strong>Return type</strong></p>
-tableElement: columnName fieldType [ NOT NULL ]
+<p>INT64</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>
+Table example:
+
++----------------+
+| characters |
++----------------+
+| абвгд |
++----------------+
+
+SELECT
+ characters,
+ CHAR_LENGTH(characters) AS char_length_example
+FROM example;
+
++------------+---------------------+
+| characters | char_length_example |
++------------+---------------------+
+| абвгд | 5 |
++------------+---------------------+
+
+</code></pre>
+</div>
+<h2 id="character_length">CHARACTER_LENGTH</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>CHARACTER_LENGTH(value)
</code></pre>
</div>
-<ul>
- <li><code class="highlighter-rouge">IF NOT EXISTS</code>: Optional. If the table is already registered, Beam SQL
-ignores the statement instead of returning an error.</li>
- <li><code class="highlighter-rouge">tableName</code>: The case sensitive name of the table to create and register,
-specified as an
-<a href="/documentation/dsls/sql/calcite/lexical#identifiers">Identifier</a>.
-The table name does not need to match the name in the underlying data
-storage system.</li>
- <li><code class="highlighter-rouge">tableElement</code>: <code class="highlighter-rouge">columnName</code> <code class="highlighter-rouge">fieldType</code> <code class="highlighter-rouge">[ NOT NULL ]</code>
- <ul>
- <li><code class="highlighter-rouge">columnName</code>: The case sensitive name of the column, specified as a
-backtick_quoted_expression.</li>
- <li><code class="highlighter-rouge">fieldType</code>: The field’s type, specified as one of the following types:
- <ul>
- <li><code class="highlighter-rouge">simpleType</code>: <code class="highlighter-rouge">TINYINT</code>, <code class="highlighter-rouge">SMALLINT</code>, <code class="highlighter-rouge">INTEGER</code>, <code class="highlighter-rouge">BIGINT</code>, <code class="highlighter-rouge">FLOAT</code>,
-<code class="highlighter-rouge">DOUBLE</code>, <code class="highlighter-rouge">DECIMAL</code>, <code class="highlighter-rouge">BOOLEAN</code>, <code class="highlighter-rouge">DATE</code>, <code class="highlighter-rouge">TIME</code>, <code class="highlighter-rouge">TIMESTAMP</code>, <code class="highlighter-rouge">CHAR</code>,
-<code class="highlighter-rouge">VARCHAR</code></li>
- <li><code class="highlighter-rouge">MAP<simpleType, fieldType></code></li>
- <li><code class="highlighter-rouge">ARRAY<fieldType></code></li>
- <li><code class="highlighter-rouge">ROW<tableElement [, tableElement ]*></code></li>
- </ul>
- </li>
- <li><code class="highlighter-rouge">NOT NULL</code>: Optional. Indicates that the column is not nullable.</li>
- </ul>
- </li>
- <li><code class="highlighter-rouge">type</code>: The I/O transform that backs the virtual table, specified as an
-<a href="/documentation/dsls/sql/calcite/lexical/#identifiers">Identifier</a>
-with one of the following values:
- <ul>
- <li><code class="highlighter-rouge">bigquery</code></li>
- <li><code class="highlighter-rouge">pubsub</code></li>
- <li><code class="highlighter-rouge">kafka</code></li>
- <li><code class="highlighter-rouge">text</code></li>
- </ul>
- </li>
- <li><code class="highlighter-rouge">location</code>: The I/O specific location of the underlying table, specified as
-a <a href="/documentation/dsls/sql/calcite/lexical/#string-literals">String
-Literal</a>.
-See the I/O specific sections for <code class="highlighter-rouge">location</code> format requirements.</li>
- <li><code class="highlighter-rouge">tblProperties</code>: The I/O specific quoted key value JSON object with extra
-configuration, specified as a <a href="/documentation/dsls/sql/calcite/lexical/#string-literals">String
-Literal</a>.
-See the I/O specific sections for <code class="highlighter-rouge">tblProperties</code> format requirements.</li>
-</ul>
+<p><strong>Description</strong></p>
+
+<p>Synonym for <a href="#char_length">CHAR_LENGTH</a>.</p>
+
+<p><strong>Return type</strong></p>
+
+<p>INT64</p>
-<h2 id="bigquery">BigQuery</h2>
+<p><strong>Examples</strong></p>
-<h3 id="syntax-1">Syntax</h3>
+<div class="highlighter-rouge"><pre class="highlight"><code>
+Table example:
+
++----------------+
+| characters |
++----------------+
+| абвгд |
++----------------+
+
+SELECT
+ characters,
+ CHARACTER_LENGTH(characters) AS char_length_example
+FROM example;
+
++------------+---------------------+
+| characters | char_length_example |
++------------+---------------------+
+| абвгд | 5 |
++------------+---------------------+
-<div class="highlighter-rouge"><pre class="highlight"><code>CREATE EXTERNAL TABLE [ IF NOT EXISTS ] tableName (tableElement [, tableElement ]*)
-TYPE bigquery
-LOCATION '[PROJECT_ID]:[DATASET].[TABLE]'
</code></pre>
</div>
-<ul>
- <li><code class="highlighter-rouge">LOCATION:</code>Location of the table in the BigQuery CLI format.
- <ul>
- <li><code class="highlighter-rouge">PROJECT_ID</code>: ID of the Google Cloud Project</li>
- <li><code class="highlighter-rouge">DATASET</code>: BigQuery Dataset ID</li>
- <li><code class="highlighter-rouge">TABLE</code>: BigQuery Table ID within the Dataset</li>
- </ul>
- </li>
-</ul>
+<h2 id="concat">CONCAT</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>CONCAT(value1[, ...])
+</code></pre>
+</div>
-<h3 id="read-mode">Read Mode</h3>
-
-<p>Beam SQL supports reading columns with simple types (<code class="highlighter-rouge">simpleType</code>) and arrays of simple
-types (<code class="highlighter-rouge">ARRAY<simpleType></code>).</p>
-
-<h3 id="write-mode">Write Mode</h3>
-
-<p>if the table does not exist, Beam creates the table specified in location when
-the first record is written. If the table does exist, the specified columns must
-match the existing table.</p>
-
-<h3 id="schema">Schema</h3>
-
-<p>Schema-related errors will cause the pipeline to crash. The Map type is not
-supported. Beam SQL types map to <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types">BigQuery Standard SQL
-types</a>
-as follows:</p>
-
-<table>
- <tr>
- <td>Beam SQL Type
- </td>
- <td>BigQuery Standard SQL Type
- </td>
- </tr>
- <tr>
- <td>TINYINT, SMALLINT, INTEGER, BIGINT
- </td>
- <td>INT64
- </td>
- </tr>
- <tr>
- <td>FLOAT, DOUBLE, DECIMAL
- </td>
- <td>FLOAT64
- </td>
- </tr>
- <tr>
- <td>BOOLEAN
- </td>
- <td>BOOL
- </td>
- </tr>
- <tr>
- <td>DATE
- </td>
- <td>DATE
- </td>
- </tr>
- <tr>
- <td>TIME
- </td>
- <td>TIME
- </td>
- </tr>
- <tr>
- <td>TIMESTAMP
- </td>
- <td>TIMESTAMP
- </td>
- </tr>
- <tr>
- <td>CHAR, VARCHAR
- </td>
- <td>STRING
- </td>
- </tr>
- <tr>
- <td>MAP
- </td>
- <td>(not supported)
- </td>
- </tr>
- <tr>
- <td>ARRAY
- </td>
- <td>ARRAY
- </td>
- </tr>
- <tr>
- <td>ROW
- </td>
- <td>STRUCT
- </td>
- </tr>
-</table>
+<p><strong>Description</strong></p>
+
+<p>Concatenates up to five values into a single
+result.</p>
+
+<p><strong>Return type</strong></p>
+
+<p>STRING</p>
+
+<p><strong>Examples</strong></p>
-<h3 id="example">Example</h3>
+<div class="highlighter-rouge"><pre class="highlight"><code>
+Table Employees:
-<div class="highlighter-rouge"><pre class="highlight"><code>CREATE EXTERNAL TABLE users (id INTEGER, username VARCHAR)
-TYPE bigquery
-LOCATION 'testing-integration:apache.users'
++-------------+-----------+
+| first_name | last_name |
++-------------+-----------+
+| John | Doe |
+| Jane | Smith |
+| Joe | Jackson |
++-------------+-----------+
+
+SELECT
+ CONCAT(first_name, " ", last_name)
+ AS full_name
+FROM Employees;
+
++---------------------+
+| full_name |
++---------------------+
+| John Doe |
+| Jane Smith |
+| Joe Jackson |
++---------------------+
+</code></pre>
+</div>
+
+<h2 id="ends_with">ENDS_WITH</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>ENDS_WITH(value1, value2)
</code></pre>
</div>
-<h2 id="pubsub">Pub/Sub</h2>
+<p><strong>Description</strong></p>
+
+<p>Takes two values. Returns TRUE if the second value is a
+suffix of the first.</p>
+
+<p><strong>Return type</strong></p>
+
+<p>BOOL</p>
-<h3 id="syntax-2">Syntax</h3>
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>
+Table items:
+
++----------------+
+| item |
++----------------+
+| apple |
+| banana |
+| orange |
++----------------+
+
+SELECT
+ ENDS_WITH(item, "e") as example
+FROM items;
+
++---------+
+| example |
++---------+
+| True |
+| False |
+| True |
++---------+
-<div class="highlighter-rouge"><pre class="highlight"><code>CREATE EXTERNAL TABLE [ IF NOT EXISTS ] tableName
- (
- event_timestamp TIMESTAMP,
- attributes MAP<VARCHAR, VARCHAR>,
- payload ROW<tableElement [, tableElement ]*>
- )
-TYPE pubsub
-LOCATION 'projects/[PROJECT]/topics/[TOPIC]'
-TBLPROPERTIES '{"timestampAttributeKey": "key", "deadLetterQueue": "projects/[PROJECT]/topics/[TOPIC]"}'
</code></pre>
</div>
-<ul>
- <li><code class="highlighter-rouge">event_timestamp</code>: The event timestamp associated with the Pub/Sub message
-by PubsubIO. It can be one of the following:
- <ul>
- <li>Message publish time, which is provided by Pub/Sub. This is the default
-value if no extra configuration is provided.</li>
- <li>A timestamp specified in one of the user-provided message attributes.
-The attribute key is configured by the <code class="highlighter-rouge">timestampAttributeKey</code> field of
-the <code class="highlighter-rouge">tblProperties</code> blob. The value of the attribute should conform to
-the <a href="https://beam.apache.org/releases/javadoc/2.4.0/org/apache/beam/sdk/io/gcp/pubsub/PubsubIO.Read.html#withTimestampAttribute-java.lang.String-">requirements of
-PubsubIO</a>,
-which is either millis since Unix epoch or <a href="https://www.ietf.org/rfc/rfc3339.txt">RFC 339
-</a>date string.</li>
- </ul>
- </li>
- <li><code class="highlighter-rouge">attributes</code>: The user-provided attributes map from the Pub/Sub message;</li>
- <li><code class="highlighter-rouge">payload</code>: The schema of the JSON payload of the Pub/Sub message. No other
-payload formats are currently supported by Beam SQL. If a record can’t be
-unmarshalled, the record is written to the topic specified in the
-<code class="highlighter-rouge">deadLeaderQueue</code> field of the <code class="highlighter-rouge">tblProperties</code> blob. If no dead-letter queue
-is specified in this case, an exception is thrown and the pipeline will
-crash.</li>
- <li><code class="highlighter-rouge">LOCATION</code>:
- <ul>
- <li><code class="highlighter-rouge">PROJECT</code>: ID of the Google Cloud Project</li>
- <li><code class="highlighter-rouge">TOPIC</code>: The Pub/Sub topic name. A subscription will be created
-automatically, but the subscription is not cleaned up automatically.
-Specifying an existing subscription is not supported.</li>
- </ul>
- </li>
- <li><code class="highlighter-rouge">TBLPROPERTIES</code>:
- <ul>
- <li><code class="highlighter-rouge">timestampAttributeKey</code>: Optional. The key which contains the event
-timestamp associated with the Pub/Sub message. If not specified, the
-message publish timestamp is used as an event timestamp for
-windowing/watermarking.</li>
- <li><code class="highlighter-rouge">deadLetterQueue</code>: The topic into which messages are written if the
-payload was not parsed. If not specified, an exception is thrown for
-parsing failures.</li>
- </ul>
- </li>
-</ul>
+<h2 id="ltrim">LTRIM</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>LTRIM(value1[, value2])
+</code></pre>
+</div>
+
+<p><strong>Description</strong></p>
+
+<p>Identical to <a href="#trim">TRIM</a>, but only removes leading characters.</p>
+
+<p><strong>Return type</strong></p>
+
+<p>STRING</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>
+Table items:
+
++----------------+
+| item |
++----------------+
+| apple |
+| banana |
+| orange |
++----------------+
+
+SELECT
+ CONCAT("#", LTRIM(item), "#") as example
+FROM items;
+
++-------------+
+| example |
++-------------+
+| #apple # |
+| #banana # |
+| #orange # |
++-------------+
+
+
+Table items:
+
++----------------+
+| item |
++----------------+
+| ***apple*** |
+| ***banana*** |
+| ***orange*** |
++----------------+
+
+SELECT
+ LTRIM(item, "*") as example
+FROM items;
+
++-----------+
+| example |
++-----------+
+| apple*** |
+| banana*** |
+| orange*** |
++-----------+
+
+
+Table items:
+
++----------------+
+| item |
++----------------+
+| xxxapplexxx |
+| yyybananayyy |
+| zzzorangezzz |
+| xyzpearzyz |
++----------------+
+
+SELECT
+ LTRIM(item, "xyz") as example
+FROM items;
+
++-----------+
+| example |
++-----------+
+| applexxx |
+| bananayyy |
+| orangezzz |
+| pearxyz |
++-----------+
+</code></pre>
+</div>
+
+<h2 id="replace">REPLACE</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>REPLACE(original_value, from_value, to_value)
+</code></pre>
+</div>
-<h3 id="read-mode-1">Read Mode</h3>
+<p><strong>Description</strong></p>
-<p>PubsubIO is currently limited to read access only.</p>
+<p>Replaces all occurrences of <code class="highlighter-rouge">from_value</code> with <code class="highlighter-rouge">to_value</code> in <code class="highlighter-rouge">original_value</code>.
+If <code class="highlighter-rouge">from_value</code> is empty, no replacement is made.</p>
-<h3 id="write-mode-1">Write Mode</h3>
+<p><strong>Return type</strong></p>
-<p>Not supported. PubSubIO is currently limited to read access only in Beam SQL.</p>
+<p>STRING</p>
-<h3 id="schema-1">Schema</h3>
+<p><strong>Examples</strong></p>
-<p>Pub/Sub messages have metadata associated with them, and you can reference this
-metadata in your queries. For each message, Pub/Sub exposes its publish time and
-a map of user-provided attributes in addition to the payload (unstructured in
-the general case). This information must be preserved and accessible from the
-SQL statements. Currently, this means that PubsubIO tables require you to
-declare a special set of columns, as shown below.</p>
+<div class="language-sql highlighter-rouge"><pre class="highlight"><code>
+<span class="o">+</span><span class="c1">--------------------+</span>
+<span class="o">|</span> <span class="n">dessert</span> <span class="o">|</span>
+<span class="o">+</span><span class="c1">--------------------+</span>
+<span class="o">|</span> <span class="n">apple</span> <span class="n">pie</span> <span class="o">|</span>
+<span class="o">|</span> <span class="n">blackberry</span> <span class="n">pie</span> <span class="o">|</span>
+<span class="o">|</span> <span class="n">cherry</span> <span class="n">pie</span> <span class="o">|</span>
+<span class="o">+</span><span class="c1">--------------------+</span>
-<h3 id="supported-payload">Supported Payload</h3>
+<span class="k">SELECT</span>
+ <span class="k">REPLACE</span> <span class="p">(</span><span class="n">dessert</span><span class="p">,</span> <span class="nv">"pie"</span><span class="p">,</span> <span class="nv">"cobbler"</span><span class="p">)</span> <span class="k">as</span> <span class="n">example</span>
+<span class="k">FROM</span> <span class="n">desserts</span><span class="p">;</span>
-<ul>
- <li>JSON Objects
- <ul>
- <li>Beam only supports querying messages with payload containing JSON
-objects. Beam attempts to parse JSON to match the schema of the
-<code class="highlighter-rouge">payload</code> field.</li>
- </ul>
- </li>
-</ul>
+<span class="o">+</span><span class="c1">--------------------+</span>
+<span class="o">|</span> <span class="n">example</span> <span class="o">|</span>
+<span class="o">+</span><span class="c1">--------------------+</span>
+<span class="o">|</span> <span class="n">apple</span> <span class="n">cobbler</span> <span class="o">|</span>
+<span class="o">|</span> <span class="n">blackberry</span> <span class="n">cobbler</span> <span class="o">|</span>
+<span class="o">|</span> <span class="n">cherry</span> <span class="n">cobbler</span> <span class="o">|</span>
+<span class="o">+</span><span class="c1">--------------------+</span>
+</code></pre>
+</div>
-<h3 id="example-1">Example</h3>
+<h2 id="reverse">REVERSE</h2>
-<div class="highlighter-rouge"><pre class="highlight"><code>CREATE EXTERNAL TABLE locations (event_timestamp TIMESTAMP, attributes MAP<VARCHAR, VARCHAR>, payload ROW<id INTEGER, location VARCHAR>)
-TYPE pubsub
-LOCATION 'projects/testing-integration/topics/user-location'
+<div class="highlighter-rouge"><pre class="highlight"><code>REVERSE(value)
</code></pre>
</div>
-<h2 id="kafka">Kafka</h2>
+<p><strong>Description</strong></p>
-<p>KafkaIO is experimental in Beam SQL.</p>
+<p>Returns the reverse of the input STRING.</p>
-<h3 id="syntax-3">Syntax</h3>
+<p><strong>Return type</strong></p>
-<div class="highlighter-rouge"><pre class="highlight"><code>CREATE EXTERNAL TABLE [ IF NOT EXISTS ] tableName (tableElement [, tableElement ]*)
-TYPE kafka
-LOCATION 'kafka://localhost:2181/brokers'
-TBLPROPERTIES '{"bootstrap.servers":"localhost:9092", "topics": ["topic1", "topic2"]}'
+<p>STRING</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>WITH example AS (
+ SELECT "foo" AS sample_string UNION ALL
+ SELECT "абвгд" AS sample_string
+)
+SELECT
+ sample_string,
+ REVERSE(sample_string) AS reverse_string
+FROM example;
+
++---------------+----------------+
+| sample_string | reverse_string |
++---------------+----------------+
+| foo | oof |
+| абвгд | дгвба |
++---------------+----------------+
</code></pre>
</div>
-<ul>
- <li><code class="highlighter-rouge">LOCATION</code>: The Kafka topic URL.</li>
- <li><code class="highlighter-rouge">TBLPROPERTIES</code>:
- <ul>
- <li><code class="highlighter-rouge">bootstrap.servers</code>: Optional. Allows you to specify the bootstrap
-server.</li>
- <li><code class="highlighter-rouge">topics</code>: Optional. Allows you to specify specific topics.</li>
- </ul>
- </li>
-</ul>
+<h2 id="rtrim">RTRIM</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>RTRIM(value1[, value2])
+</code></pre>
+</div>
-<h3 id="read-mode-2">Read Mode</h3>
+<p><strong>Description</strong></p>
-<p>Read Mode supports reading from a topic.</p>
+<p>Identical to <a href="#trim">TRIM</a>, but only removes trailing characters.</p>
-<h3 id="write-mode-2">Write Mode</h3>
+<p><strong>Return type</strong></p>
-<p>Write Mode supports writing to a topic.</p>
+<p>STRING</p>
-<h3 id="supported-payload-1">Supported Payload</h3>
+<p><strong>Examples</strong></p>
-<ul>
- <li>CSV
- <ul>
- <li>Beam parses the messages, attempting to parse fields according to the
-types specified in the schema.</li>
- </ul>
- </li>
-</ul>
+<div class="highlighter-rouge"><pre class="highlight"><code>
+Table items:
+
++----------------+
+| item |
++----------------+
+| ***apple*** |
+| ***banana*** |
+| ***orange*** |
++----------------+
-<h3 id="schema-2">Schema</h3>
+SELECT
+ RTRIM(item, "*") as example
+FROM items;
-<p>Only simple types are supported.</p>
++-----------+
+| example |
++-----------+
+| ***apple |
+| ***banana |
+| ***orange |
++-----------+
-<h2 id="text">Text</h2>
-<p>TextIO is experimental in Beam SQL. Read Mode and Write Mode do not currently
-access the same underlying data.</p>
+Table items:
-<h3 id="syntax-4">Syntax</h3>
++----------------+
+| item |
++----------------+
+| applexxx |
+| bananayyy |
+| orangezzz |
+| pearxyz |
++----------------+
-<div class="highlighter-rouge"><pre class="highlight"><code>CREATE EXTERNAL TABLE [ IF NOT EXISTS ] tableName (tableElement [, tableElement ]*)
-TYPE text
-LOCATION '/home/admin/orders'
-TBLPROPERTIES '{"format: "Excel"}'
+SELECT
+ RTRIM(item, "xyz") as example
+FROM items;
+
++---------+
+| example |
++---------+
+| apple |
+| banana |
+| orange |
+| pear |
++---------+
</code></pre>
</div>
-<ul>
- <li><code class="highlighter-rouge">LOCATION</code>: The path to the file for Read Mode. The prefix for Write Mode.</li>
- <li><code class="highlighter-rouge">TBLPROPERTIES</code>:
- <ul>
- <li><code class="highlighter-rouge">format</code>: Optional. Allows you to specify the CSV Format, which controls
-the field delimeter, quote character, record separator, and other properties.
-See the following table:</li>
- </ul>
- </li>
-</ul>
-
-<table class="table-bordered">
- <thead>
- <tr>
- <th>Value for <code class="highlighter-rouge">format</code></th>
- <th>Field delimiter</th>
- <th>Quote</th>
- <th>Record separator</th>
- <th>Ignore empty lines?</th>
- <th>Allow missing column names?</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code class="highlighter-rouge">default</code></td>
- <td><code class="highlighter-rouge">,</code></td>
- <td><code class="highlighter-rouge">"</code></td>
- <td><code class="highlighter-rouge">\r\n</code></td>
- <td>Yes</td>
- <td>No</td>
- </tr>
- <tr>
- <td><code class="highlighter-rouge">rfc4180</code></td>
- <td><code class="highlighter-rouge">,</code></td>
- <td><code class="highlighter-rouge">"</code></td>
- <td><code class="highlighter-rouge">\r\n</code></td>
- <td>No</td>
- <td>No</td>
- </tr>
- <tr>
- <td><code class="highlighter-rouge">excel</code></td>
- <td><code class="highlighter-rouge">,</code></td>
- <td><code class="highlighter-rouge">"</code></td>
- <td><code class="highlighter-rouge">\r\n</code></td>
- <td>No</td>
- <td>Yes</td>
- </tr>
- <tr>
- <td><code class="highlighter-rouge">tdf</code></td>
- <td><code class="highlighter-rouge">\t</code></td>
- <td><code class="highlighter-rouge">"</code></td>
- <td><code class="highlighter-rouge">\r\n</code></td>
- <td>Yes</td>
- <td>No</td>
- </tr>
- <tr>
- <td><code class="highlighter-rouge">mysql</code></td>
- <td><code class="highlighter-rouge">\t</code></td>
- <td>none</td>
- <td><code class="highlighter-rouge">\n</code></td>
- <td>No</td>
- <td>No</td>
- </tr>
- </tbody>
-</table>
+<h2 id="starts_with">STARTS_WITH</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>STARTS_WITH(value1, value2)
+</code></pre>
+</div>
-<h3 id="read-mode-3">Read Mode</h3>
+<p><strong>Description</strong></p>
-<p>Read Mode supports reading from a file.</p>
+<p>Takes two values. Returns TRUE if the second value is a prefix
+of the first.</p>
-<h3 id="write-mode-3">Write Mode</h3>
+<p><strong>Return type</strong></p>
-<p>Write Mode supports writing to a set of files. TextIO creates file on writes.</p>
+<p>BOOL</p>
-<h3 id="supported-payload-2">Supported Payload</h3>
+<p><strong>Examples</strong></p>
-<ul>
- <li>CSV
- <ul>
- <li>Beam parses the messages, attempting to parse fields according to the
-types specified in the schema using org.apache.commons.csv.</li>
- </ul>
- </li>
-</ul>
+<div class="highlighter-rouge"><pre class="highlight"><code>
+SELECT
+ STARTS_WITH(item, "b") as example
+FROM (
+ SELECT "foo" as item
+ UNION ALL SELECT "bar" as item
+ UNION ALL SELECT "baz" as item) AS items;
-<h3 id="schema-3">Schema</h3>
-<p>Only simple types are supported.</p>
++---------+
+| example |
++---------+
+| False |
+| True |
+| True |
++---------+
+</code></pre>
+</div>
+<h2 id="substr">SUBSTR</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>SUBSTR(value, position[, length])
+</code></pre>
+</div>
-<h3 id="example-2">Example</h3>
+<p><strong>Description</strong></p>
+
+<p>Returns a substring of the supplied value. The
+<code class="highlighter-rouge">position</code> argument is an integer specifying the starting position of the
+substring, with position = 1 indicating the first character or byte. The
+<code class="highlighter-rouge">length</code> argument is the maximum number of characters for STRING arguments.</p>
+
+<p>If <code class="highlighter-rouge">position</code> is negative, the function counts from the end of <code class="highlighter-rouge">value</code>,
+with -1 indicating the last character.</p>
+
+<p>If <code class="highlighter-rouge">position</code> is a position off the left end of the
+STRING (<code class="highlighter-rouge">position</code> = 0 or
+<code class="highlighter-rouge">position</code> < <code class="highlighter-rouge">-LENGTH(value)</code>), the function starts
+from position = 1. If <code class="highlighter-rouge">length</code> exceeds the length of
+<code class="highlighter-rouge">value</code>, returns fewer than <code class="highlighter-rouge">length</code> characters.</p>
+
+<p>If <code class="highlighter-rouge">length</code> is less than 0, the function returns an error.</p>
+
+<p><strong>Return type</strong></p>
+
+<p>STRING</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>
+Table items:
+
++----------------+
+| item |
++----------------+
+| apple |
+| banana |
+| orange |
++----------------+
+
+SELECT
+ SUBSTR(item, 2) as example
+FROM items;
+
++---------+
+| example |
++---------+
+| pple |
+| anana |
+| range |
++---------+
+
+
+Table items:
+
++----------------+
+| item |
++----------------+
+| apple |
+| banana |
+| orange |
++----------------+
+
+SELECT
+ SUBSTR(item, 2, 2) as example
+FROM items;
+
++---------+
+| example |
++---------+
+| pp |
+| an |
+| ra |
++---------+
+
+
+Table items:
+
++----------------+
+| item |
++----------------+
+| apple |
+| banana |
+| orange |
++----------------+
+
+SELECT
+ SUBSTR(item, -2) as example
+FROM items;
+
++---------+
+| example |
++---------+
+| le |
+| na |
+| ge |
++---------+
+</code></pre>
+</div>
+<h2 id="trim">TRIM</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>TRIM(value1[, value2])
+</code></pre>
+</div>
-<div class="highlighter-rouge"><pre class="highlight"><code>CREATE EXTERNAL TABLE orders (id INTEGER, price INTEGER)
-TYPE text
-LOCATION '/home/admin/orders'
+<p><strong>Description</strong></p>
+
+<p>Removes all leading and trailing characters that match <code class="highlighter-rouge">value2</code>. If <code class="highlighter-rouge">value2</code> is
+not specified, all leading and trailing whitespace characters (as defined by the
+Unicode standard) are removed.</p>
+
+<p>If <code class="highlighter-rouge">value2</code> contains more than one character, the function removes all leading
+or trailing characters contained in <code class="highlighter-rouge">value2</code>.</p>
+
+<p><strong>Return type</strong></p>
+
+<p>STRING</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="highlighter-rouge"><pre class="highlight"><code>
+Table items:
+
++----------------+
+| item |
++----------------+
+| apple |
+| banana |
+| orange |
++----------------+
+
+SELECT
+ CONCAT("#", TRIM(item), "#") as example
+FROM items;
+
++----------+
+| example |
++----------+
+| #apple# |
+| #banana# |
+| #orange# |
++----------+
+
+
+Table items:
+
++----------------+
+| item |
++----------------+
+| ***apple*** |
+| ***banana*** |
+| ***orange*** |
++----------------+
+
+SELECT
+ TRIM(item, "*") as example
+FROM items;
+
++---------+
+| example |
++---------+
+| apple |
+| banana |
+| orange |
++---------+
+
+
+Table items:
+
++----------------+
+| item |
++----------------+
+| xxxapplexxx |
+| yyybananayyy |
+| zzzorangezzz |
+| xyzpearxyz |
++----------------+
+
+SELECT
+ TRIM(item, "xyz") as example
+FROM items;
+
++---------+
+| example |
++---------+
+| apple |
+| banana |
+| orange |
+| pear |
++---------+
</code></pre>
</div>
diff --git a/website/generated-content/documentation/dsls/sql/extensions/set/index.html b/website/generated-content/documentation/dsls/sql/zetasql/syntax/index.html
similarity index 88%
copy from website/generated-content/documentation/dsls/sql/extensions/set/index.html
copy to website/generated-content/documentation/dsls/sql/zetasql/syntax/index.html
index 45afb30..696fd47 100644
--- a/website/generated-content/documentation/dsls/sql/extensions/set/index.html
+++ b/website/generated-content/documentation/dsls/sql/zetasql/syntax/index.html
@@ -28,7 +28,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Beam SQL extensions: SET and RESET Statement</title>
+ <title>Beam ZetaSQL function call rules</title>
<meta name="description" content="Apache Beam is an open source, unified model and set of language-specific SDKs for defining and executing data processing workflows, and also data ingestion and integration flows, supporting Enterprise Integration Patterns (EIPs) and Domain Specific Languages (DSLs). Dataflow pipelines simplify the mechanics of large-scale batch and streaming data processing and can run on a number of runtimes like Apache Flink, Apache Spark, and Google Cloud Dataflow [...]
">
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400" rel="stylesheet">
@@ -39,7 +39,7 @@
<script src="/js/fix-menu.js"></script>
<script src="/js/section-nav.js"></script>
<script src="/js/page-nav.js"></script>
- <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/extensions/set/" data-proofer-ignore>
+ <link rel="canonical" href="https://beam.apache.org/documentation/dsls/sql/zetasql/syntax/" data-proofer-ignore>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico">
<link rel="alternate" type="application/rss+xml" title="Apache Beam" href="https://beam.apache.org/feed.xml">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">
@@ -141,7 +141,7 @@
GitHub links will not resolve until the markdown source is available on the master branch.
New pages would fail validation during development / PR test automation.
-->
- <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/extensions/set.md" data-proofer-ignore>
+ <a href="https://github.com/apache/beam/edit/master/website/src/documentation/dsls/sql/zetasql/syntax.md" data-proofer-ignore>
<i class="far fa-edit fa-lg" alt="Edit on GitHub" title="Edit on GitHub"></i>
</a>
</li>
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
@@ -260,10 +283,6 @@
-<ul class="nav">
- <li><a href="#syntax">Syntax</a></li>
- <li><a href="#common-options">Common Options</a></li>
-</ul>
</nav>
@@ -283,46 +302,22 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<h1 id="beam-sql-extensions-set-and-reset-pipeline-options">Beam SQL extensions: SET and RESET Pipeline Options</h1>
-
-<p>Beam SQL’s <code class="highlighter-rouge">SET</code> and <code class="highlighter-rouge">RESET</code> statements allow the user to <a href="/documentation/programming-guide/#configuring-pipeline-options">configure Pipeline
-Options</a>
-via the SQL shell. These are the same Pipeline Options passed to other Beam
-applications on the command line in the <code class="highlighter-rouge">--<option>=<value></code> format.</p>
-
-<h2 id="syntax">Syntax</h2>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>SET option = value
-</code></pre>
-</div>
-
-<p>The SET command sets a Pipeline Option.</p>
-
-<ul>
- <li><code class="highlighter-rouge">option</code>: The case sensitive name of the Pipeline Option, specified as an
-<a href="/documentation/dsls/sql/calcite/lexical/#identifiers">Identifier</a>.</li>
- <li><code class="highlighter-rouge">value</code>: The case sensitive value of the Pipeline Option, specified as an
-<a href="/documentation/dsls/sql/calcite/lexical/#identifiers">Identifier</a>.
-For flag options that have no value on the command line, use <code class="highlighter-rouge">true</code>.</li>
-</ul>
-
-<div class="highlighter-rouge"><pre class="highlight"><code>RESET option
-</code></pre>
-</div>
-
-<p>The RESET command resets a Pipeline Option to its default value.</p>
-
-<ul>
- <li><code class="highlighter-rouge">option</code>: The case sensitive name of the Pipeline Option, specified as an
-<a href="/documentation/dsls/sql/calcite/lexical#identifiers">Identifier</a>.</li>
-</ul>
+<h1 id="beam-zetasql-function-call-rules">Beam ZetaSQL function call rules</h1>
-<h2 id="common-options">Common Options</h2>
+<p>The following rules apply to all functions unless explicitly indicated otherwise in the function description:</p>
<ul>
- <li><code class="highlighter-rouge">SET project = `my_gcp_project`</code>: Sets the default GCP project
-to<code class="highlighter-rouge">my_gcp_project</code>.</li>
- <li><code class="highlighter-rouge">SET runner = DataflowRunner</code>: Sets the pipeline to run on Dataflow.</li>
+ <li>For functions that accept numeric types, if one operand is a floating point
+operand and the other operand is another numeric type, both operands are
+converted to FLOAT64 before the function is
+evaluated.</li>
+ <li>
+ <p>If an operand is <code class="highlighter-rouge">NULL</code>, the result is <code class="highlighter-rouge">NULL</code>, with the exception of the
+IS operator.</p>
+ </li>
+ <li>For functions that are time zone sensitive (as indicated in the function
+description), the default time zone, UTC, is used if a time
+zone is not specified.</li>
</ul>
</div>
diff --git a/website/generated-content/documentation/sdks/feature-comparison/index.html b/website/generated-content/documentation/sdks/feature-comparison/index.html
index 8c67551..18c1676 100644
--- a/website/generated-content/documentation/sdks/feature-comparison/index.html
+++ b/website/generated-content/documentation/sdks/feature-comparison/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/go/index.html b/website/generated-content/documentation/sdks/go/index.html
index 96bf3ae..1540ea6 100644
--- a/website/generated-content/documentation/sdks/go/index.html
+++ b/website/generated-content/documentation/sdks/go/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/java-dependencies/index.html b/website/generated-content/documentation/sdks/java-dependencies/index.html
index 8caff3b..c41e599 100644
--- a/website/generated-content/documentation/sdks/java-dependencies/index.html
+++ b/website/generated-content/documentation/sdks/java-dependencies/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/java-extensions/index.html b/website/generated-content/documentation/sdks/java-extensions/index.html
index c720649..fd9b300 100644
--- a/website/generated-content/documentation/sdks/java-extensions/index.html
+++ b/website/generated-content/documentation/sdks/java-extensions/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/java-thirdparty/index.html b/website/generated-content/documentation/sdks/java-thirdparty/index.html
index 9c72597..1570dbc 100644
--- a/website/generated-content/documentation/sdks/java-thirdparty/index.html
+++ b/website/generated-content/documentation/sdks/java-thirdparty/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/java/euphoria/index.html b/website/generated-content/documentation/sdks/java/euphoria/index.html
index 69bdf3b..7bec5a5 100644
--- a/website/generated-content/documentation/sdks/java/euphoria/index.html
+++ b/website/generated-content/documentation/sdks/java/euphoria/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/java/index.html b/website/generated-content/documentation/sdks/java/index.html
index 9aee72a..cbd3e21 100644
--- a/website/generated-content/documentation/sdks/java/index.html
+++ b/website/generated-content/documentation/sdks/java/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/java/testing/nexmark/index.html b/website/generated-content/documentation/sdks/java/testing/nexmark/index.html
index 2b63ae2..d133551 100644
--- a/website/generated-content/documentation/sdks/java/testing/nexmark/index.html
+++ b/website/generated-content/documentation/sdks/java/testing/nexmark/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/python-dependencies/index.html b/website/generated-content/documentation/sdks/python-dependencies/index.html
index b7a1681..10ffce6 100644
--- a/website/generated-content/documentation/sdks/python-dependencies/index.html
+++ b/website/generated-content/documentation/sdks/python-dependencies/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/python-pipeline-dependencies/index.html b/website/generated-content/documentation/sdks/python-pipeline-dependencies/index.html
index d270dea..aba2b20 100644
--- a/website/generated-content/documentation/sdks/python-pipeline-dependencies/index.html
+++ b/website/generated-content/documentation/sdks/python-pipeline-dependencies/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/python-streaming/index.html b/website/generated-content/documentation/sdks/python-streaming/index.html
index 1f5e509..f874433 100644
--- a/website/generated-content/documentation/sdks/python-streaming/index.html
+++ b/website/generated-content/documentation/sdks/python-streaming/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/python-type-safety/index.html b/website/generated-content/documentation/sdks/python-type-safety/index.html
index 2817adb..1f120e8 100644
--- a/website/generated-content/documentation/sdks/python-type-safety/index.html
+++ b/website/generated-content/documentation/sdks/python-type-safety/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">
diff --git a/website/generated-content/documentation/sdks/python/index.html b/website/generated-content/documentation/sdks/python/index.html
index 1215177..36e18c4 100644
--- a/website/generated-content/documentation/sdks/python/index.html
+++ b/website/generated-content/documentation/sdks/python/index.html
@@ -228,6 +228,29 @@
</ul>
</li>
<li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">ZetaSQL dialect</span>
+
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/overview/">ZetaSQL support overview</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/syntax/">Function call rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conversion-rules/">Conversion rules</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/query-syntax/">Query syntax</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/lexical/">Lexical structure</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/data-types/">Data types</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/operators/">Operators</a></li>
+
+ <li class="section-nav-item--collapsible">
+ <span class="section-nav-list-title">Scalar functions</span>
+ <ul class="section-nav-list">
+ <li><a href="/documentation/dsls/sql/zetasql/string-functions/">String functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/math-functions/">Mathematical functions</a></li>
+ <li><a href="/documentation/dsls/sql/zetasql/conditional-expressions/">Conditional expressions</a></li>
+ </ul>
+ </li>
+ <li><a href="/documentation/dsls/sql/zetasql/aggregate-functions/">Aggregate functions</a></li>
+ </ul>
+ </li>
+ <li class="section-nav-item--collapsible">
<span class="section-nav-list-title">Beam SQL extensions</span>
<ul class="section-nav-list">