Skip to main content

UNSET VARIABLE

Description

This statement is used to restore Doris system variables. These system variables can be modified at global or session level.

Syntax

UNSET [<effective_scope>] VARIABLE (<variable_name>)

Required Parameters

1. <variable_name>

Specifies the variable name, or if you want to unset all variables, this parameter you can give a keyword ALL.

Optional Parameters

1. <effective_scope>

Effective scope is one of GLOBAL or SESSION or LOCAL. If there is no effective scope, default value is SESSION. LOCAL is an alias of SESSION.

Access Control Requirements

Users executing this SQL command must have at least the following privileges:

PrivilegeObjectNotes
ADMIN_PRIVSessionunset global variables need admin privilege

Usage Notes

  • Only ADMIN users can unset variables to take effect globally
  • When restore a variable with GLOBAL, it only affects your current using session and new open sessions. It does not affect other current open sessions.

Example

  • Restore value of the time zone

    UNSET VARIABLE time_zone;
  • Restore the global execution memory size

    UNSET GLOBAL VARIABLE exec_mem_limit;
  • Restore all variables globally

    UNSET GLOBAL VARIABLE ALL;