Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on
04-23-2019
11:01 PM
- last edited on
06-07-2026
11:55 PM
by
VidyaSargur
I need to change the column order in a Hive table, but I want to make sure I can do it without deleting any of the existing data.
Created 04-24-2019 02:42 PM
Hi,
This command moves column_name after column_name2:
alter table table_name change column column_name column_name column_name_type after column_name2;
You have to put the column_name twice (or you can change column name) and type of the column.
Regards
Andrzej
Created 04-24-2019 02:42 PM
Hi,
This command moves column_name after column_name2:
alter table table_name change column column_name column_name column_name_type after column_name2;
You have to put the column_name twice (or you can change column name) and type of the column.
Regards
Andrzej
Created 11-30-2022 06:40 AM
In this solution, we are able to change position of a single column. Is it possible to change positions of 2 or more consecutive columns in the same way ?
Created 05-07-2019 09:35 PM
Created 05-09-2019 06:27 PM
That's ok
Created on 05-15-2019 01:58 AM - edited 05-15-2019 02:00 AM
You are right - thank you for pointing this out.