RE: Connecting to Hive from R through JDBC

2013-05-08 Thread Saurabh S
listens on port 1 by default. Also on a side note is I hope your Hive connecting to MySQL or some non-derby RDBMS :-) Thanks sanjay From: Saurabh S Reply-To: "user@hive.apache.org" Date: Tuesday, May 7, 2013 11:55 AM To: "user@hive.apache.org" Subject

Connecting to Hive from R through JDBC

2013-05-07 Thread Saurabh S
Hi, I'm trying to use package RJDBC to connect to hive through R. My client machine, on which R is installed, is Windows 7. I installed the package, then copied the file hive-jdbc-0.9.0-cdh4.1.2.jar to my local R work folder. Then used the following commands: I was able to read the driver throug

Custom UDF in Python?

2012-06-05 Thread Saurabh S
Is it possible to write Hive UDFs in Python? I googled but didn't find anything. I would be happy with RTFM replies if you can give link to the manual.

RE: 'set cli header' throws null pointer exception

2012-06-01 Thread Saurabh S
l pointer exception > To: user@hive.apache.org > > Which version of Hive are you running? > > On Fri, Jun 1, 2012 at 3:49 PM, Saurabh S wrote: > > > > Well it seems that simply moving the set header statement after the 'c

RE: 'set cli header' throws null pointer exception

2012-06-01 Thread Saurabh S
Well it seems that simply moving the set header statement after the 'create temporary function' statement works just fine. > From: saurab...@live.com > To: user@hive.apache.org > Subject: 'set cli header' throws null pointer exception > Date: Fri, 1 Jun 2

'set cli header' throws null pointer exception

2012-06-01 Thread Saurabh S
This is a weird issue. I've been setting hive CLI headers for a long time using the following: set hive.cli.print.header=true; Recently, I started using custom Hive UDF. Here is my test file, myfunc.sql: -- add jar ; create temporary function as ; ; ; -- This works just fine. However, if I a

Hive equivalent of group_concat() ?

2012-05-11 Thread Saurabh S
As far as I understand, there is no equivalent of MySQL group_concat() in Hive. This stackoverflow question is from Sept 2010: http://stackoverflow.com/questions/3703740/combine-multiple-rows-into-one-space-separated-string Does anyone know any other method to create a delimited list from from

RE: Passing date as hive configuration variable

2012-05-10 Thread Saurabh S
27;ll want to wrap ${hiveconf:ref_date} in quotes, so that's it's passed > >as a string in the query. > > > >SELECT "${hiveconf:ref_date}" FROM dummytable LIMIT 1; > > > >Matt Tucker > >Associate eBusiness Analyst > >Walt Disney Parks and R

Passing date as hive configuration variable

2012-05-10 Thread Saurabh S
I'm having a hard time passing a date as a hive environment variable. The setting is this: The table I'm querying is partitioned on a date column, say, local_dt. I wish to query on last two days' worth of data. Unfortunately there seems to be no way of getting the current date without either sc

Get current date in hive

2012-04-25 Thread Saurabh S
Hi, How do I get the current date in Hive? Specifically, I’m looking for the equivalent of following SQL where clause: where LOCAL_DT >= current date - 3 day I tried using where local_dt >= date_sub(to_date(unix_timestamp()), 3) but this method seems to be many times slower than

Hive equivalent of row_number()

2012-04-12 Thread Saurabh S
I have a table with three columns, A, B, and Score, where A and B are some items, and Score is some kind of affinity between A and B. There are N number of items of each A and B, so that the total number of rows in the table are N^2. Is there a way to fetch "top 5 items in B" for each item in A

RE: Help in aggregating comma separated values

2012-03-28 Thread Saurabh S
after the ‘3’ but before the tab? Matt Tucker From: Saurabh S [mailto:saurab...@live.com] Sent: Wednesday, March 28, 2012 2:45 PM To: user@hive.apache.org Subject: RE: Help in aggregating comma separated values Thanks for the reply, Matt. This is exactly what I'm looking for. I'll l

RE: Help in aggregating comma separated values

2012-03-28 Thread Saurabh S
ues, ",")) values_tbl as value > GROUP BY id, value > > > > Matt Tucker > > -Original Message- > From: Saurabh S [mailto:saurab...@live.com] > Sent: Wednesday, March 28, 2012 2:21 PM > To: user@hive.apache.org > Subject: Help in aggregating comma separate

Help in aggregating comma separated values

2012-03-28 Thread Saurabh S
Hello, How do I get count from a list of comma separated values? For the lack of better wording, here is an example: Suppose there is a table with two columns, id (integers) and values (string) in the following fashion. id   values 1    10,20,30 2    20,30 2    20 3    20,30,40 3    40,20,30

Length of an array

2012-03-21 Thread Saurabh S
How do I get the length of an array in Hive? Specifically, I'm looking at the following problem: I'm splitting a column using the split() function and a pattern. However, the resulting array can have variable number of entries and I want to handle each case separately.

RE: Accessing elements from array returned by split() function

2012-03-01 Thread Saurabh S
ip.j.trom...@gmail.com > To: user@hive.apache.org > > I guess that split(...)[1] is giving you what's inbetween the 1st and > 2nd '/' character, which is nothing. Try split(...)[2]. > > Phil. > > On 1 March 2012 21:19, Saurabh S wrote: > > Hello, > > >

Accessing elements from array returned by split() function

2012-03-01 Thread Saurabh S
Hello, I have a set of URLs which I need to parse. For example, if the url is, http://www.google.com/anything/goes/here, I need to extract www.google.com, i.e. everything between second and third forward slashes. I can't figure out the regex pattern to do so, and am trying to use split() func