RE: Convert date in string format to timestamp in table definition

2016-06-05 Thread Markovitz, Dudu
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

Re: Convert date in string format to timestamp in table definition

2016-06-05 Thread Jörn Franke
Never use string when you can use int - the performance will be much better - especially for tables in Orc / parquet format > On 04 Jun 2016, at 22:31, Igor Kravzov wrote: > > Thanks Dudu. > So if I need actual date I will use view. > Regarding partition column: I can create 2 external table

Re: Convert date in string format to timestamp in table definition

2016-06-04 Thread Igor Kravzov
Thanks Mich. This date is informational for now. Will see once I need it. On Sat, Jun 4, 2016 at 5:23 PM, Mich Talebzadeh wrote: > or just create an internal table and do insert/select from external table > to that table as Dudu mentioned > > hive> use test; > OK > hive> desc mytime; > OK > addd

Re: Convert date in string format to timestamp in table definition

2016-06-04 Thread Mich Talebzadeh
or just create an internal table and do insert/select from external table to that table as Dudu mentioned hive> use test; OK hive> desc mytime; OK adddate timestamp hive> insert into > test.mytime > select cast(concat_ws(' ',substring ("2016-05-17T02:10:44.527",1,10),subst

Re: Convert date in string format to timestamp in table definition

2016-06-04 Thread Igor Kravzov
Thanks Dudu. So if I need actual date I will use view. Regarding partition column: I can create 2 external tables based on the same data with integer or string column partition and see which one is more convenient for our use. On Sat, Jun 4, 2016 at 2:20 PM, Markovitz, Dudu wrote: > I’m not awa

RE: Convert date in string format to timestamp in table definition

2016-06-04 Thread Markovitz, Dudu
I’m not aware of an option to do what you request in the external table definition but you might want to that using a view. P.s. I seems to me that defining the partition column as a string would be more user friendly than integer, e.g. – select * from threads_test where mmdd like ‘2016%’ –