current_user function (Databricks SQL)

Returns the user executing the statement.

Syntax

current_user()

Arguments

This function takes no arguments.

Returns

A STRING.

The braces are optional.

Examples

> SELECT current_user();
 user1

> SELECT current_user;
 user1