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
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.
: 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
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
*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
.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
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
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
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
Gotcha, thanks !
pk
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
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,
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
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
14 matches
Mail list logo