Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and expand UDF docs #24441

Merged
merged 6 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions docs/src/main/sphinx/admin/properties-sql-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ client overrides this default.

- **Type:** [](prop-type-string)

Set the default catalog for [SQL routine](/routines) storage for all clients.
The connector used in the catalog must support [](sql-routine-management). Any
usage of a fully qualified name for a routine overrides this default.
Set the default catalog for [](/udf) storage for all clients. The connector used
in the catalog must support [](udf-management). Any usage of a fully qualified
name for a UDF overrides this default.

The default catalog and schema for SQL routine storage must be configured
together, and the resulting entry must be set as part of the path. For example,
the following example section for [](config-properties) uses the `functions`
schema in the `brain` catalog for routine storage, and adds it as the only entry
on the path:
The default catalog and schema for UDF storage must be configured together, and
the resulting entry must be set as part of the path. For example, the following
section for [](config-properties) uses the `functions` schema in the `brain`
catalog for UDF storage, and adds it as the only entry on the path:

```properties
sql.default-function-catalog=brain
Expand All @@ -51,9 +50,9 @@ sql.path=brain.default

- **Type:** [](prop-type-string)

Set the default schema for SQL routine storage for all clients. Must be set to a
schema name that is valid for the default function catalog. Any usage of a fully
qualified name for a routine overrides this default.
Set the default schema for UDF storage for all clients. Must be set to a schema
name that is valid for the default function catalog. Any usage of a fully
qualified name for a UDF overrides this default.

## `sql.path`

Expand Down
3 changes: 1 addition & 2 deletions docs/src/main/sphinx/client/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ mode:
- Do not show query processing progress.
* - `--path`
- Set the default [SQL path](/sql/set-path) for the session. Useful for
setting a catalog and schema location for [catalog
routines](routine-catalog).
setting a catalog and schema location for [](udf-catalog).
* - `--password`
- Prompts for a password. Use if your Trino server requires password
authentication. You can set the `TRINO_PASSWORD` environment variable with
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/client/jdbc.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ may not be specified using both methods.
- Client tags for selecting resource groups. Example: `abc,xyz`
* - `path`
- Set the default [SQL path](/sql/set-path) for the session. Useful for
setting a catalog and schema location for [catalog routines](routine-catalog).
setting a catalog and schema location for [](udf-catalog).
* - `traceToken`
- Trace token for correlating requests across systems.
* - `source`
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/connector/hive.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ configured object storage system and metadata stores:
- {ref}`sql-view-management`; see also
{ref}`Hive-specific view management <hive-sql-view-management>`

- [](sql-routine-management)
- [](udf-management)
- {ref}`sql-security-operations`: see also
{ref}`SQL standard-based authorization for object storage <hive-sql-standard-based-authorization>`

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/connector/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ statements, the connector supports the following features:
- {doc}`/sql/alter-schema`
- {doc}`/sql/comment`
- [](sql-view-management)
- [](sql-routine-management)
- [](udf-management)

### TRUNCATE and DROP TABLE

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Refer to the following sections for further details:
In addition, Trino supports implementation of [custom
functions](/develop/functions) or [custom table
functions](/develop/table-functions) provided by a plugin, and creation of
user-defined functions as [SQL routines](/routines).
[](/udf).

## Functions by name

Expand Down
8 changes: 4 additions & 4 deletions docs/src/main/sphinx/functions/conditional.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SELECT a, b,
END
```

SQL routines can use [`CASE` statements](/routines/case) that use a slightly
SQL UDFs can use [`CASE` statements](/udf/sql/case) that use a slightly
different syntax from the CASE expressions. Specifically note the requirements
for terminating each clause with a semicolon `;` and the usage of `END CASE`.

Expand Down Expand Up @@ -95,9 +95,9 @@ SELECT
FROM tpch.sf1.orders;
```

SQL routines can use [`IF` statements](/routines/if) that use a slightly
different syntax from `IF` expressions. Specifically note the requirement
for terminating each clause with a semicolon `;` and the usage of `END IF`.
SQL UDFs can use [`IF` statements](/udf/sql/if) that use a slightly different
syntax from `IF` expressions. Specifically note the requirement for terminating
each clause with a semicolon `;` and the usage of `END IF`.

(coalesce-function)=
## COALESCE
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ optimizer
connector
object-storage
functions
udf
language
sql
routines
develop
glossary
appendix
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/sphinx/language/sql-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ connector to connector:
- {doc}`/sql/drop-materialized-view`
- {doc}`/sql/refresh-materialized-view`

(sql-routine-management)=
### Routine management
(udf-management)=
### User-defined function management

The following statements are used to manage [catalog routines](routine-catalog):
The following statements are used to manage [](udf-catalog):

- [](/sql/create-function)
- [](/sql/drop-function)
Expand Down
15 changes: 15 additions & 0 deletions docs/src/main/sphinx/redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,18 @@ connector/atop.md connector/removed.md
connector/localfile.md connector/removed.md
connector/accumulo.md connector/removed.md
security/apache-ranger-access-control.md security/ranger-access-control.md
routines.md udf.md
routines/function.md udf/function.md
routines/introduction.md udf/introduction.md
routines/begin.md udf/sql/begin.md
routines/case.md udf/sql/case.md
routines/declare.md udf/sql/declare.md
routines/examples.md udf/sql/examples.md
routines/if.md udf/sql/if.md
routines/iterate.md udf/sql/iterate.md
routines/leave.md udf/sql/leave.md
routines/loop.md udf/sql/loop.md
routines/repeat.md udf/sql/repeat.md
routines/return.md udf/sql/return.md
routines/set.md udf/sql/set.md
routines/while.md udf/sql/while.md
6 changes: 3 additions & 3 deletions docs/src/main/sphinx/release/release-431.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## General

* Add support for [](/routines). ({issue}`19308`)
* Add support for [](/udf/sql). ({issue}`19308`)
* Add support for [](/sql/create-function) and [](/sql/drop-function) statements. ({issue}`19308`)
* Add support for the `REPLACE` modifier to the `CREATE TABLE` statement. ({issue}`13180`)
* Disallow a `null` offset for the {func}`lead` and {func}`lag` functions. ({issue}`19003`)
Expand All @@ -27,7 +27,7 @@

## Hive connector

* Add support for [SQL routine management](sql-routine-management). ({issue}`19308`)
* Add support for [](udf-management). ({issue}`19308`)
* Replace the `hive.metastore-timeout` Hive metastore configuration property
with the `hive.metastore.thrift.client.connect-timeout` and
`hive.metastore.thrift.client.read-timeout` properties. ({issue}`19390`)
Expand All @@ -50,7 +50,7 @@

## Memory connector

* Add support for [SQL routine management](sql-routine-management). ({issue}`19308`)
* Add support for [](udf-management). ({issue}`19308`)

## SPI

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/release/release-436.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[](jvm-config). ({issue}`20010`)
* Improve performance by not generating redundant predicates. ({issue}`16520`)
* Fix query failure when invoking the `json_table` function. ({issue}`20122`)
* Fix query hang when a [SQL routine](/routines) dereferences a row field. ({issue}`19997`).
* Fix query hang when a [](/udf/sql) dereferences a row field. ({issue}`19997`).
* Fix potential incorrect results when using the {func}`ST_Centroid` and
{func}`ST_Buffer` functions for tiny geometries. ({issue}`20237`)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/release/release-440.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Fix query failure when a check constraint is null. ({issue}`20906`)
* Fix query failure for aggregations over `CASE` expressions when the input
evaluation could throw an error. ({issue}`20652`)
* Fix incorrect behavior of the else clause in a SQL routines with a single
* Fix incorrect behavior of the else clause in a SQL UDFs with a single
if/end condition. ({issue}`20926`)
* Fix the `ALTER TABLE EXECUTE optimize` queries failing due to exceeding the
open writer limit. ({issue}`20871`)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/sphinx/release/release-446.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
statement. ({issue}`21619`)
* Fix `CREATE CATALOG` statements including quotes in catalog names. ({issue}`21399`)
* Fix potential query failure when a column name ends with a `:`. ({issue}`21676`)
* Fix potential query failure when a [SQL routine](/routines) contains a label
* Fix potential query failure when a [](/udf/sql) contains a label
reference in a `LEAVE`, `ITERATE`, `REPEAT`, or `WHILE` statement. ({issue}`21682`)
* Fix query failure when [SQL routines](/routines) use the `NULLIF` or `BETWEEN`
* Fix query failure when [](/udf/sql) use the `NULLIF` or `BETWEEN`
functions. ({issue}`19820`)
* Fix potential query failure due to worker nodes running out of memory in
concurrent scenarios. ({issue}`21706`)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/release/release-447.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## CLI

* Fix incorrect error location markers for SQL routines causing CLI to print
* Fix incorrect error location markers for SQL UDFs causing the CLI to print
exceptions. ({issue}`21357`)

## Delta Lake connector
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/release/release-453.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
`hive.metastore.glue.use-web-identity-token-credentials-provider`
configuration property. ({issue}`15267`)
* Fix failure to read Hive tables migrated to Iceberg with Apache Spark. ({issue}`11338`)
* Fix failure for `CREATE FUNCTION` with SQL routine storage in Glue when
* Fix failure for `CREATE FUNCTION` with SQL UDF storage in Glue when
`hive.metastore.glue.catalogid` is set. ({issue}`22717`)

## Hudi connector
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/release/release-454.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

## Web UI

* Add information about which tables and routines have been referenced by a
* Add information about which tables and UDFs have been referenced by a
query. ({issue}`20843`)

## JDBC driver
Expand Down
25 changes: 0 additions & 25 deletions docs/src/main/sphinx/routines.md

This file was deleted.

57 changes: 0 additions & 57 deletions docs/src/main/sphinx/routines/begin.md

This file was deleted.

Loading
Loading