Re: Query question.

2016-03-12 Thread Mich Talebzadeh
That select (count(*) from Table_X tx where tx.blah = 0.75 will return a single value y and 0.5 * y will be a single value.. Where does sum come into it. It is normally applied to GROUP BY statements. Can you provide the original SQL if you have (Oracle, Sybase whatever)? HTH Dr Mich Talebzade

Query question.

2016-03-12 Thread ws
I need to re-write something like this to Hive: ###select  x.A, sum(0.5 * (select (count(*) from Table_X tx where tx.blah = 0.75)))from Table_X x### Thanks in advance for any pointer to it.

RE: simple insert query question

2014-06-20 Thread Jamie Thomson - Contractor
: Nitin Pawar [mailto:nitinpawar...@gmail.com] Sent: 19 June 2014 15:08 To: user@hive.apache.org Cc: Nishant Kelkar Subject: Re: simple insert query question remember in hive, insert operation is 1) from a file 2) from another table hive's underlying storage is hdfs which is not meant for h

RE: simple insert query question

2014-06-19 Thread Clay McDonald
Got it. Thanks! From: Nitin Pawar [mailto:nitinpawar...@gmail.com] Sent: Thursday, June 19, 2014 10:08 AM To: user@hive.apache.org Cc: Nishant Kelkar Subject: Re: simple insert query question remember in hive, insert operation is 1) from a file 2) from another table hive's underlying st

Re: simple insert query question

2014-06-19 Thread Nitin Pawar
*To:* user@hive.apache.org; Clay McDonald > *Subject:* Re: simple insert query question > > > > Hey Stuart, > > As far as I know, files in HDFS are immutable. So I would think that your > query below would not have a direct Hive conversion. > > What you can do though, is cre

RE: simple insert query question

2014-06-19 Thread Clay McDonald
.org; Clay McDonald Subject: Re: simple insert query question Hey Stuart, As far as I know, files in HDFS are immutable. So I would think that your query below would not have a direct Hive conversion. What you can do though, is create a local text file and then create an EXTERNAL TABLE on t

RE: simple insert query question

2014-06-19 Thread Clay McDonald
From: Clay McDonald Sent: Thursday, June 19, 2014 9:17 AM To: user Subject: simple insert query question hi all, how do I write the following query to insert a note with a current system timestamp? I tried the following; INSERT INTO TEST_LOG VALUES (unix_timestamp(),'THIS IS A TEST.'); thanks, Clay

Re: simple insert query question

2014-06-19 Thread Nishant Kelkar
Hey Stuart, As far as I know, files in HDFS are immutable. So I would think that your query below would not have a direct Hive conversion. What you can do though, is create a local text file and then create an EXTERNAL TABLE on top of that. Then, instead of your INSERT query, just use some linux

simple insert query question

2014-06-19 Thread Clay McDonald
hi all, how do I write the following query to insert a note with a current system timestamp? I tried the following; INSERT INTO TEST_LOG VALUES (unix_timestamp(),'THIS IS A TEST.'); thanks, Clay

Re: Hive Query Question

2011-06-20 Thread Praveen Kumar
Gotcha, thanks ! pk

Re: Hive Query Question

2011-06-13 Thread Tim Spence
Praveen, My apologies--I meant to suggest a streaming function because a UDF would not be able to hold state either. Look at the documentation for TRANSFORM ( http://wiki.apache.org/hadoop/Hive/LanguageManual/Transform ). Your transformation script can be used to compare timestamps from successiv

Re: Hive Query Question

2011-06-11 Thread Praveen
Do you mean that my UDF would store the timestamp of the current row in a static field in the UDF's implementation, and when processing the next row, use that field to get the previous row's value ? Can anyone comment on whether that's safe, re: I'm not familiar with Hive internals ? Thanks,

Re: Hive Query Question

2011-06-10 Thread Tim Spence
Praveen, This would be best accomplished with a UDF because Hive does not support cursors. Best of luck, Tim On Fri, Jun 10, 2011 at 10:29 PM, Praveen Kumar wrote: > If I have table timestamps: > > hive> desc timestamps; > > OK > ts bigint > > > hive> select ts from timestamps order by t

Hive Query Question

2011-06-10 Thread Praveen Kumar
If I have table timestamps: hive> desc timestamps; OK ts bigint hive> select ts from timestamps order by ts OK 1 2 3 4 5 6 7 8 9 10 30 32 34 36 38 40 42 44 46 48 50 70 74 78 100 105 110 115 and I want to make groups of the values where splits between groups occur where two time-consecu