Your table has to support transactions (see Inserting values into tables from SQL <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-InsertingvaluesintotablesfromSQL>), so create it with the TBLPROPERTIES clause <https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions#HiveTransactions-TableProperties> :
CREATE TABLE tmp (reporttime timestamp) TBLPROPERTIES ("transactional"="true"); Unfortunately the examples in Inserting values into tables from SQL <https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-InsertingvaluesintotablesfromSQL> don't show the TBLPROPERTIES clause -- that needs to be fixed in the wiki. -- Lefty On Mon, Oct 26, 2015 at 8:49 PM, AnandaVelMurugan Chandra Mohan < ananthu2...@gmail.com> wrote: > Hi, > > I believe my Hive version is Apache 1.2.0. I guessed it from the folder > and hive-hwi.jar names. > > I am trying to insert values into a column of type timestamp. It does not > work > > This is how I create the table > CREATE TABLE tmp (reporttime timestamp); > > I tried following insert queries > INSERT INTO TABLE tmp VALUES(734196.3552); > > INSERT INTO TABLE tmp VALUES(734196); > > I read that values of timestamp could be integers which are interpreted as > seconds since unix epoch time or float which are interpreted as seconds > since unix epoch time with nanasecond precision or string of format > 'YYYY-mm-dd'. I cannot use third string option as of now. So I am trying > other two options i.e. int and float. > > When I do a select query, I get null > > I tried > > select to_date(reporttime) from tmp > select reporttime from tmp > > Please help if you have any idea. > -- > Regards, > Anand >