From bad358af7a6c5c09da233cd58ada88308ca10921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E4=BA=A6=E8=B6=85=28=E4=BD=95=E5=85=AE=29?= Date: Thu, 12 May 2016 13:28:55 +0800 Subject: [PATCH] odps-ddl: add page Change-Id: I75366bdb9f6c96136c4838c6961159418a77dae7 --- pages/common/odps-sql.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pages/common/odps-sql.md diff --git a/pages/common/odps-sql.md b/pages/common/odps-sql.md new file mode 100644 index 000000000..0e570e4fb --- /dev/null +++ b/pages/common/odps-sql.md @@ -0,0 +1,23 @@ +# odps ddl + +> Run ddl task in odps. + +- Create a table with partition and lifecycle: + +`create table {{table_name}} ({{col}} {{type}}) partitioned by ({{col}} {{type}}) lifecycle {{days}};` + +- Create a table based on the definition of another table: + +`create table {{table_name}} like {{another_table}};` + +- Add parition to a table: + +`alter table {{table_name}} add parition ({{partition_spec}});` + +- Delete partition from a table: + +`alter table {{table_name}} drop partition ({{partition_spec}});` + +- Delete table: + +`drop table {{table_name}};`