I have a Hive table such as:
CREATE TABLE mytest (name int, timestamp bigint, donation int);
I am using Hive 0.12. Pay attention to the "timestamp" field. By the way, in Hive 0.12+ there is a new data type called timestamp. Say I want to rename this field totime_stamp
I tried:
ALTER TABLE mytest CHANGE timestamp time_stamp BIGINT;ALTER TABLE mytest CHANGE COLUMN timestamp time_stamp BIGINT;ALTER TABLE mytest CHANGE [timestamp] time_stamp BIGINT;ALTER TABLE mytest CHANGE `timestamp` time_stamp BIGINT;
However, they all give me the following error:
FAILED: ParseException line 1:38 mismatched input 'CHANGE' expecting KW_EXCHANGE near 'mytest' in alter exchange partition
I am sure that this is because the name of my field matches the name of the data type. How to change the circuit for mytest without to do the following?
CREATE mytest_cpy AS SELECT mytest.name, mytest.timestamp AS time_stamp,
mytest.donation FROM mytest;
DROP TABLE mytest;
ALTER TABLE mytest_cpy RENAME TO mytest;
Thank! Any / all help is appreciated!
source
share