USE Statement

Specify the computing resources for the current session

Syntax

--Switch computing resources
USE VCLUSTER vc_name;

Parameter Description

  1. VCLUSTER: This is an optional keyword that must be filled in.
  2. schema_name: Specifies the name of the computing resource to switch to.

Example

  1. Suppose there is a computing cluster named sample_vc in the current workspace, you can use the following command to switch to that computing cluster:
USE VCLUSTER sample_vc;
 --Query the current computing resources
 SELECT CURRENT_VCLUSTER();
  1. If you want to switch to the computing cluster named high_performance_vc, you can execute the following command:
    USE VCLUSTER high_performance_vc;

Notes

  • When connecting using client tools (such as Client SQLLine, DBeaver, etc.), the relevant operations will take effect for the entire session. If you are using the Lakehouse Studio interface, it is recommended to switch Schemas and compute clusters via the page. It should be noted that if you directly use the relevant commands, their effects will only be temporary and will only take effect if selected together with the SQL to be executed.