Login using Social Account
     Continue with GoogleLogin using your credentials
Important Note - We recommend you to execute the given commands on Hive Console instead of Hue. The video is only for representational purposes.
Let's make changes in the table definition.
To rename a table x
to x1
, type ALTER TABLE x RENAME TO x1
. Click on execute and refresh the list. Table x
is renamed to x1
.
To change the datatype of the column "a" in table x1
to Float, we can simply type ALTER TABLE x1 CHANGE a a FLOAT;
. Click on execute and refresh the list. The datatype of column "a" is changed to float.
To add column "b" with float data type and column "c" with int data type, type ALTER TABLE x1 ADD COLUMNS (b FLOAT, c INT);
. Click on execute and refresh the list. Now table x1
has two new columns "b" and "c".
hive
on the console. Run below commands in Hive.Use your database by using the below command. ${env:USER}
gets replaced by your username automatically:
use ${env:USER};
To rename a table from x to x1
ALTER TABLE x RENAME TO x1;
To change the data type of a column
ALTER TABLE x1 CHANGE a a FLOAT;
To add columns to an existing table
ALTER TABLE x1 ADD COLUMNS (b FLOAT, c INT);
Loading comments...