目前的分区表是这样的:
CREATE TABLE `szddemo.partition_fix_dict_ios_month_uv_backup`( |
| `datasource` string, |
| `version` string, |
| `uv` string) |
| PARTITIONED BY ( |
| `month` string)
replace修改一下:
alter table szddemo.partition_fix_dict_ios_month_uv_backup replace columns(datasource string,version string)partitioned by (month string);
报错:
貌似是不能删除表字段的,参考链接:
stackoverflow
Unfortunately, you can't! The only way you can delete column from existing table is by using REPLACE COLUMNS keyword. But this can be done only for tables with a native SerDe (DynamicSerDe, MetadataTypedColumnsetSerDe, LazySimpleSerDe and ColumnarSerDe).
只能通过外部表的方式来新建另外一张表(去掉要删除的字段)