Introduction to the
TODO…
There’s no need to write this article, but save it as a note. I don’t think you can find anything as good as Hive Wiki.
Hive Wiki hyperlink attached:
Cwiki.apache.org/confluence/…
Increase the field
alter table table_name add columns (column_1 string,column_2 int) -- Fields will be added to the end of the original table
Copy the code
Modify the fields
alter table table_name change column_1 column_new string;
Copy the code
Modifying field position
alter table table_name change column_1 column_1 string after column_2 ; Move to the column_2 field
Copy the code
Delete the field
alter table table_name replace columns(column_2 string);
Copy the code
Modify comments for fields
alter table table_name change column cloumn_1 cloumn_1 string COMMENT'Modify the field comment to... ';
Copy the code