From 0a8865bd437bc82134d49b1bc425018c2783fdb9 Mon Sep 17 00:00:00 2001 From: Manfred Moser Date: Tue, 26 Sep 2023 10:56:44 -0700 Subject: [PATCH] Improve SQL language landing pages * And table of content moves --- docs/src/main/sphinx/functions.md | 26 ++++++++++++------- docs/src/main/sphinx/language.md | 13 +++++++--- .../main/sphinx/{sql => language}/comments.md | 2 +- docs/src/main/sphinx/sql.md | 16 ++++++++---- docs/src/main/sphinx/sql/comment.md | 2 +- docs/src/main/sphinx/sql/select.md | 3 +-- 6 files changed, 41 insertions(+), 21 deletions(-) rename docs/src/main/sphinx/{sql => language}/comments.md (97%) diff --git a/docs/src/main/sphinx/functions.md b/docs/src/main/sphinx/functions.md index 91885e47236f..3478e1a92786 100644 --- a/docs/src/main/sphinx/functions.md +++ b/docs/src/main/sphinx/functions.md @@ -4,14 +4,24 @@ This section describes the built-in SQL functions and operators supported by Trino. They allow you to implement complex capabilities and behavior of the queries executed by Trino operating on the underlying data sources. -If you are looking for a specific function or operator, see the {doc}`full -alphabetical list` or the {doc}`full list by -topic`. Using {doc}`SHOW FUNCTIONS -` returns a list of all available functions, including -custom functions, with all supported arguments and a short description. +Refer to the following sections for further details: -Also see the {doc}`SQL data types` -and the {doc}`SQL statement and syntax reference`. +* [SQL data types and other general aspects](/language) +* [SQL statement and syntax reference](/sql) + +## Functions by name + +If you are looking for a specific function or operator by name use +[](/sql/show-functions), or refer the to the following resources: + +:::{toctree} +:maxdepth: 1 + +functions/list +functions/list-by-topic +::: + +## Functions per topic ```{toctree} :maxdepth: 1 @@ -47,6 +57,4 @@ T-Digest URL UUID Window -functions/list -functions/list-by-topic ``` diff --git a/docs/src/main/sphinx/language.md b/docs/src/main/sphinx/language.md index 15286eb208c1..9c163f9252ef 100644 --- a/docs/src/main/sphinx/language.md +++ b/docs/src/main/sphinx/language.md @@ -10,15 +10,22 @@ operations on the connected data source. This section provides a reference to the supported SQL data types and other general characteristics of the SQL support of Trino. -A {doc}`full SQL statement and syntax reference` is -available in a separate section. +Refer to the following sections for further details: + +* [SQL statement and syntax reference](/sql) +* [SQL functions and operators](/functions) -Trino also provides {doc}`numerous SQL functions and operators`. ```{toctree} :maxdepth: 2 language/sql-support language/types +``` + +```{toctree} +:maxdepth: 1 + language/reserved +language/comments ``` diff --git a/docs/src/main/sphinx/sql/comments.md b/docs/src/main/sphinx/language/comments.md similarity index 97% rename from docs/src/main/sphinx/sql/comments.md rename to docs/src/main/sphinx/language/comments.md index 6cdb93f70129..eb16146388c5 100644 --- a/docs/src/main/sphinx/sql/comments.md +++ b/docs/src/main/sphinx/language/comments.md @@ -23,4 +23,4 @@ SELECT * FROM table; -- This comment is ignored. ## See also -[](./comment) +[](/sql/comment) diff --git a/docs/src/main/sphinx/sql.md b/docs/src/main/sphinx/sql.md index 6305cdfd323c..59a65fa9d41c 100644 --- a/docs/src/main/sphinx/sql.md +++ b/docs/src/main/sphinx/sql.md @@ -1,10 +1,12 @@ # SQL statement syntax -This section describes the SQL syntax used in Trino. +This section describes the syntax for SQL statements that can be executed in +Trino. -A {doc}`reference to the supported SQL data types` is available. +Refer to the following sections for further details: -Trino also provides {doc}`numerous SQL functions and operators`. +* [SQL data types and other general aspects](/language) +* [SQL functions and operators](/functions) ```{toctree} :maxdepth: 1 @@ -16,7 +18,6 @@ sql/alter-view sql/analyze sql/call sql/comment -sql/comments sql/commit sql/create-materialized-view sql/create-role @@ -44,7 +45,6 @@ sql/grant-roles sql/insert sql/match-recognize sql/merge -sql/pattern-recognition-in-window sql/prepare sql/refresh-materialized-view sql/reset-session @@ -78,3 +78,9 @@ sql/update sql/use sql/values ``` + +```{toctree} +:hidden: + +sql/pattern-recognition-in-window +``` diff --git a/docs/src/main/sphinx/sql/comment.md b/docs/src/main/sphinx/sql/comment.md index 317fb0cb8859..8ed32a746ae1 100644 --- a/docs/src/main/sphinx/sql/comment.md +++ b/docs/src/main/sphinx/sql/comment.md @@ -32,4 +32,4 @@ COMMENT ON COLUMN users.name IS 'full name'; ## See also -[](./comments) +[](/language/comments) diff --git a/docs/src/main/sphinx/sql/select.md b/docs/src/main/sphinx/sql/select.md index f9cb799b1bd7..c3d9fc092816 100644 --- a/docs/src/main/sphinx/sql/select.md +++ b/docs/src/main/sphinx/sql/select.md @@ -711,8 +711,7 @@ A window specification has the following components: consists of the rows matched by a pattern starting from that row. Additionally, if the frame specifies row pattern measures, they can be called over the window, similarly to window functions. For more details, see - {doc}`Row pattern recognition in window structures - `. + [Row pattern recognition in window structures](/sql/pattern-recognition-in-window) . Each window component is optional. If a window specification does not specify window partitioning, ordering or frame, those components are obtained from