Skip to content
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
4 changes: 2 additions & 2 deletions docs/src/main/sphinx/release/release-470.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

* Add [](/connector/duckdb). ({issue}`18031`)
* Add [](/connector/loki). ({issue}`23053`)
* Add support for `WITH SESSION` to set per-query session properties with
`SELECT` queries. ({issue}`24889`)
* Add support for the [](select-with-session) to set per-query session
properties with `SELECT` queries. ({issue}`24889`)
* Improve compatibility of fault-tolerant exchange storage with S3-compliant
object stores. ({issue}`24822`)
* Allow skipping directory schema validation to improve compatibility of
Expand Down
25 changes: 25 additions & 0 deletions docs/src/main/sphinx/sql/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,31 @@ ROLLUP ( column [, ...] )

Retrieve rows from zero or more tables.

(select-with-session)=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a reference here from https://trino.io/docs/current/sql/set-session.html ?

Copy link
Copy Markdown
Member Author

@mosabua mosabua Feb 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure .. send a PR or maybe someone from the docs team can help.. probably worth a sentence in there and a link in See also at the bottom.

## WITH SESSION clause

The `WITH SESSION` clause allows you to [set session and catalog session
property values](/sql/set-session) applicable for the processing of the current
SELECT statement only. The defined values override any other configuration and
session property settings. Multiple properties are separated by commas.

The following example overrides the global configuration property
`query.max-execution-time` with the session property `query_max_execution_time`
to reduce the time to `2h`. It also overrides the catalog property
`iceberg.query-partition-filter-required` from the `example` catalog using
[](/connector/iceberg) setting the catalog session property
`query_partition_filter_required` to `true`:

```sql
WITH
SESSION
query_max_execution_time='2h',
example.query_partition_filter_required=true
SELECT *
FROM example.default.thetable
LIMIT 100;
```

## WITH FUNCTION clause

The `WITH FUNCTION` clause allows you to define a list of [](udf-inline) that
Expand Down