tldr/pages/common/odps-ddl.md
程亦超(何兮) b0e464f98c odps-ddl: rename file
Change-Id: I07dca5d9f840490130111da257c38b4d93f4da6d
2016-05-12 13:31:28 +08:00

544 B

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}};