Description

This command is used to query detailed information about all computing clusters in the current workspace.

Syntax

SHOW VCLUSTERS [LIKE PATTERN | WHERE expr]

Parameter Description

  1. LIKE PATTERN (optional): Filter by object name, supports case-insensitive pattern matching. SQL wildcards % and _ can be used. For example, LIKE '%testing%'. Note that the LIKE clause cannot be used simultaneously with the WHERE clause.

  2. WHERE expr (optional): Apply conditional filtering to the compute clusters based on specific attributes, supporting the following attributes:

  • vcluster_size: Compute cluster specification code, such as XSMALL, SMALL, etc., using uppercase letters.
  • vcluster_type: Compute cluster type, such as ANALYTICS, GENERAL, using uppercase letters.
  • max_concurrency: Filter by the number of concurrent connections, input a number.
  • state: Compute cluster state, such as RESUMING, SUSPENDED, etc., using uppercase letters.
  • createor: The username of the user who created the compute cluster, using lowercase letters.
  • create_time: Creation time, formatted as "yyyy-mm-dd hh:mm:ss", stored as a string, supports comparison operators.
  • min_replicas: Minimum number of compute instances, input a number.
  • max_replicas: Maximum number of compute instances, input a number.
  • preload_table: List of table names in the cache, stored as a string, can use the LIKE clause to match specific table names.
  • current_replicas: Current number of compute instances in the compute cluster, input a number.
  • auto_suspend_in_second: Number of seconds for the compute cluster to auto-suspend, input a number.

Example

  1. Query all compute clusters in the current workspace:
    SHOW VCLUSTERS;
  2. Query the compute clusters in the current workspace whose names start with the first two letters "CZ":
    SHOW VCLUSTERS LIKE 'CZ%';
3. Use the WHERE clause to filter the list of computing cluster results:
SHOW VCLUSTERS WHERE vcluster_type = 'GENERAL';
SHOW VCLUSTERS WHERE vcluster_size = 'SMALL';
SHOW VCLUSTERS WHERE max_concurrency = 8;
SHOW VCLUSTERS WHERE state = 'SUSPENDED';
SHOW VCLUSTERS WHERE createor = 'demo_project';
SHOW VCLUSTERS WHERE create_time > '2024-01-25';
SHOW VCLUSTERS WHERE min_replicas = 1;
SHOW VCLUSTERS WHERE max_replicas = 2;
SHOW VCLUSTERS WHERE preload_tables LIKE '%sample_schema.sample_table%';
SHOW VCLUSTERS WHERE current_replicas = 3;
SHOW VCLUSTERS WHERE auto_suspend_in_second = 600;

Through the above examples, you can flexibly query and filter computing cluster information as needed. Please ensure that when using the WHERE clause, you use the correct case and operators to obtain accurate query results.