mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 14:05:27 +00:00
4eea9c20ee
* Fix "Description"s for various sections in the functions pages. * Added a TIP for searching using a routing key. * Other small polishings (cherry picked from commit 9fad0b1ac4409a42c435ed040f41cbaea18930a3)
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
[role="xpack"]
|
|
[testenv="basic"]
|
|
[[sql-functions-system]]
|
|
=== System Functions
|
|
|
|
These functions return metadata type of information about the system being queried.
|
|
|
|
[[sql-functions-system-database]]
|
|
==== `DATABASE`
|
|
|
|
.Synopsis:
|
|
[source, sql]
|
|
--------------------------------------------------
|
|
DATABASE()
|
|
--------------------------------------------------
|
|
|
|
*Input*: _none_
|
|
|
|
*Output*: string
|
|
|
|
*Description*: Returns the name of the database being queried. In the case of Elasticsearch SQL, this
|
|
is the name of the Elasticsearch cluster. This function should always return a non-null
|
|
value.
|
|
|
|
[source, sql]
|
|
--------------------------------------------------
|
|
include-tagged::{sql-specs}/docs/docs.csv-spec[database]
|
|
--------------------------------------------------
|
|
|
|
[[sql-functions-system-user]]
|
|
==== `USER`
|
|
|
|
.Synopsis:
|
|
[source, sql]
|
|
--------------------------------------------------
|
|
USER()
|
|
--------------------------------------------------
|
|
*Input*: _none_
|
|
|
|
*Output*: string
|
|
|
|
*Description*: Returns the username of the authenticated user executing the query. This function can
|
|
return `null` in case <<elasticsearch-security,security>> is disabled.
|
|
|
|
[source, sql]
|
|
--------------------------------------------------
|
|
include-tagged::{sql-specs}/docs/docs.csv-spec[user]
|
|
--------------------------------------------------
|