Files
tldr/pages.zh/common/odps-table.md

25 lines
667 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# odps 表
> 在 ODPS开放数据处理服务中创建和修改表。
> 另请参见 `odps`。
> 更多信息:<https://www.alibabacloud.com/help/doc-detail/27971.htm>。
- 创建一个带有分区和生命周期的表:
`create table {{table_name}} ({{col}} {{type}}) partitioned by ({{col}} {{type}}) lifecycle {{days}};`
- 基于另一个表的定义创建表:
`create table {{table_name}} like {{another_table}};`
- 向表中添加分区:
`alter table {{table_name}} add partition ({{partition_spec}});`
- 从表中删除分区:
`alter table {{table_name}} drop partition ({{partition_spec}});`
- 删除表:
`drop table {{table_name}};`