Skip to main content
Version: 2.15.0

多语句DDL(DDL Multi-Statements)

支持用分号隔开多个DDL语句一次执行,以表格的方式顺序返回DDL执行结果。

DDL包括CREATECREATE OR REPLACE, DROPDROP IF EXISTS

现在支持用DDL改变的数据类型:VIEW, TABLE(EVENT SET), FUNCTION, LOOKUP TABLE, MATERIALZIE VIEW.

示例

创建无依赖的SELECT 1视图 view_demo_1view_demo_2,然后替换为有依赖的视图.

CREATE TABLE table_demo; CREATE VIEW view_demo_1 as select 1; CREATE VIEW view_demo_2 as select 1; 
CREATE OR REPLACE VIEW view_demo_1 as select * from view_demo_2; CREATE OR REPLACE VIEW view_demo_2 as select * from table_demo

返回table示例:

statuserrorstatus_code
SucceededNull0
SucceededNull0
SucceededNull0
SucceededNull0
SucceededNull0

删除上面建立的视图和数据集

DROP VIEW view_demo_1 ; DROP VIEW view_demo_2; DROP TABLE table_demo
caution

注意:

  • 在DDL多语句执行中,炎凰数据平台是顺序执行的,后续执行出错的DDL将不会ROLLBACK整个执行多语句,建议用户使用CREATE OR REPLACEDROP IF EXISTS来进行改动。
  • 在多语句执行中不支持DML语句,包括INSERT插入语句和SEARCH查询语句,会在返回的表格中显示 failed to execute: non DDL statements not allowed in multi-statement execution 错误。