跳到主要内容

RENAME WAREHOUSE

Introduced or updated: v1.2.687

将现有的计算集群重命名为新名称。

当您重命名计算集群时,如果尝试 USE 重命名的计算集群而不先退出并重新连接,会话将遇到错误。这是因为会话仍然引用旧的计算集群名称。要解决此问题,请退出当前会话,然后在尝试使用重命名的计算集群之前重新连接。

Example:
root@(test_warehouse_1)/default> rename warehouse test_warehouse_1 to test_warehouse;

rename warehouse test_warehouse_1 to test_warehouse

0 row read in 0.027 sec. Processed 0 row, 0 B (0 row/s, 0 B/s)

root@(test_warehouse_1)/default> use warehouse test_warehouse;
error: APIError: fail to POST http://localhost:8000/v1/query: BadRequest:(500 Internal Server Error)[500]Some(500) UnknownWarehouse. Code: 2406, Text = Unknown warehouse or self managed warehouse "test_warehouse_1"
(while in warehouse request forward).

root@(test_warehouse_1)/default> exit
Bye~

root@localhost:8000/default> use warehouse test_warehouse;

use warehouse test_warehouse

0 row read in 0.019 sec. Processed 0 row, 0 B (0 row/s, 0 B/s)

语法

RENAME WAREHOUSE <current_name> TO <new_name>

示例

此示例将 test_warehouse_1 重命名为 test_warehouse

RENAME WAREHOUSE test_warehouse_1 TO test_warehouse;
欢迎体验 Databend Cloud

基于 Rust + 对象存储构建的新一代多模态数仓,一个平台即可进行 BI、向量、全文检索及地理空间分析。

支持标准 SQL,自动弹性伸缩,助您快速构建现代化数据平台。

注册即领 ¥200 代金券。

注册体验