Skip to content

Commit

Permalink
Improve SQL language landing pages
Browse files Browse the repository at this point in the history
* And table of content moves
  • Loading branch information
mosabua committed Oct 11, 2023
1 parent 9972481 commit 37b0457
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 21 deletions.
26 changes: 17 additions & 9 deletions docs/src/main/sphinx/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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</functions/list>` or the {doc}`full list by
topic</functions/list-by-topic>`. Using {doc}`SHOW FUNCTIONS
</sql/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</language>`
and the {doc}`SQL statement and syntax reference</sql>`.
* [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
Expand Down Expand Up @@ -47,6 +57,4 @@ T-Digest <functions/tdigest>
URL <functions/url>
UUID <functions/uuid>
Window <functions/window>
functions/list
functions/list-by-topic
```
13 changes: 10 additions & 3 deletions docs/src/main/sphinx/language.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<sql>` 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<functions>`.

```{toctree}
:maxdepth: 2
language/sql-support
language/types
```

```{toctree}
:maxdepth: 1
language/reserved
language/comments
```
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ SELECT * FROM table; -- This comment is ignored.

## See also

[](./comment)
[](/sql/comment)
16 changes: 11 additions & 5 deletions docs/src/main/sphinx/sql.md
Original file line number Diff line number Diff line change
@@ -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</language>` is available.
Refer to the following sections for further details:

Trino also provides {doc}`numerous SQL functions and operators<functions>`.
* [SQL data types and other general aspects](/language)
* [SQL functions and operators](/functions)

```{toctree}
:maxdepth: 1
Expand All @@ -16,7 +18,6 @@ sql/alter-view
sql/analyze
sql/call
sql/comment
sql/comments
sql/commit
sql/create-materialized-view
sql/create-role
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -78,3 +78,9 @@ sql/update
sql/use
sql/values
```

```{toctree}
:hidden:
sql/pattern-recognition-in-window
```
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/sql/comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ COMMENT ON COLUMN users.name IS 'full name';

## See also

[](./comments)
[](/language/comments)
3 changes: 1 addition & 2 deletions docs/src/main/sphinx/sql/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
</sql/pattern-recognition-in-window>`.
[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
Expand Down

0 comments on commit 37b0457

Please sign in to comment.