ALTER SESSION SET
Change a parameter value for the current session.
EXECUTOR_DEVICE
CPU - Set the session to CPU execution mode:
ALTER SESSION SET EXECUTOR_DEVICE='CPU';
GPU - Set the session to GPU execution mode:
ALTER SESSION SET EXECUTOR_DEVICE='GPU';
NOTE: These parameter values have the same effect as the \cpu
and \gpu
commands in heavysql, but can be used with any tool capable of running sql commands.
CURRENT_DATABASE
Can be set to any string value.
If the value is a valid database name, and the current user has access to it, the session switches to the new database. If the user does not have access or the database does not exist, an error is returned and the session will fall back to the starting database.
Alter Session Examples
CURRENT_DATABASE
Switch to another database without need of re-login.
Your session will silently switch to the requested database.
The database exists, but the user does not have access to it:
The database does not exist:
EXECUTOR_DEVICE
Force the session to run the subsequent SQL commands in CPU mode:
Switch back the session to run in GPU mode
Last updated