being held in the metastore (at least with
MySQL) as strings
Dudu
From: Jörn Franke [mailto:jornfra...@gmail.com]
Sent: Sunday, June 05, 2016 11:38 AM
To: user@hive.apache.org
Subject: Re: Convert date in string format to timestamp in table definition
Never use string when you can use int - the
e> select * from threads_test;
>>
>>
>>
>> www.blablabla.compg12016-05-17T02:10:44.5272016-05-16T02:08:55
>> YadaYada 20160604
>>
>>
>>
>> hive>
>>
>> create view threads_test_v
>>
>> as
>
>>> ;
>>>
>>>
>>>
>>> hive> alter table threads_test add partition (mmdd=20160604)
>>> location '/tmp/threads_test/20160604';
>>>
>>>
>>>
>>> hive> select * from threads_test;
>>>
>
>> hive> alter table threads_test add partition (mmdd=20160604) location
>> '/tmp/threads_test/20160604';
>>
>>
>>
>> hive> select * from threads_test;
>>
>>
>>
>> www.blablabla.compg1 2016-05-17T02:10:44.527
>> 2016-
0),substr (adddate
> ,12)) as timestamp) as adddate
>
> ,cast (concat_ws(' ',substr (postdate,1,10),substr
> (postdate,12)) as timestamp) as postdate
>
>,posttext
>
>
>
> fromthreads_test
>
> ;
>
>
>
> hive
threads_test
;
hive> select * from threads_test_v;
www.blablabla.compg12016-05-17 02:10:44.5272016-05-16 02:08:55
YadaYada
From: Igor Kravzov [mailto:igork.ine...@gmail.com]
Sent: Saturday, June 04, 2016 8:13 PM
To: user@hive.apache.org
Subject: Convert date in string format to timestam
Hi,
I have 2 dates in Json file defined like this
"addDate": "2016-05-17T02:10:44.527",
"postDate": "2016-05-16T02:08:55",
Right now I define external table based on this file like this:
CREATE external TABLE threads_test
(url string,
pagetype string,
adddate string,
postdate string,
postte