Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> The Confused question  of hive  udf


Copy link to this message
-
Re: The Confused question  of hive  udf
Hi,
There isn't much information here for us to say much. Could you share you code so we can take a look at what could be wrong?
Possibly, issue a query like:
select createtime, minf(createtime) as minf from table limit 500;

so you can see if there is anything out of the ordinary with the parameter(s) that return wrong values.

Perhaps, share your create table statement as well?

Mark

Mark Grover, Business Intelligence Analyst
OANDA Corporation

www: oanda.com www: fxtrade.com

----- Original Message -----
From: "王锋" <[EMAIL PROTECTED]>
To: "user" <[EMAIL PROTECTED]>
Sent: Friday, May 11, 2012 4:10:19 AM
Subject: The Confused question  of hive  udf
Hi,
we have an udf called minf which can change current time to one point .
for example 20120510:00:00:00 --> minf 20120510000,
20120510:00:06:00 -> minf 20120510001
20120510:10:51:38 -> minf 20120510130
we test the minf function using main function ,it is normal.
but when using in hive,the sql :
select minf(createtime) as minf from table limit 500;
the results are normally sometime:

20120510195
20120510195
20120510195
20120510195
20120510198
20120510198
20120510198
20120510198
20120510196
20120510197
20120510198
20120510197
20120510195
20120510196
20120510196
20120510196
20120510195
20120510196
20120510195
20120510195
20120510195
20120510195
20120510195
20120510195
20120510197
20120510196
20120510197
20120510196
20120510196
20120510196
20120510196
20120510196
20120510196
20120510197
20120510197
20120510197
20120510198
20120510197
20120510198
20120510197
20120510198
20120510198
20120510198
20120510198
but sometime the results are unnormally:

20120510195
20120510198
20120510198
20120510198
20120510198
20120510195
20120510195
20120510195
2012[10198
2012[10198
2012[10198
2012[10198
20120510196
2012[10196
20120510195
20120510197
2012[10198
2012[10197
2012[10197
20120510197
20120510195
20120510195
20120510198
20120510196
2012[10196
20120510195
2012[10196
2012[10198
2012[10198
20120510196
2012[10196
2012[10196
2012[10196
20120510196
2012[10196
20120510196
2012[10196
20120510196
2012[10196
20120510196
20120510196
20120510196
2012[10196
20120510195
20120510196
2012[10198
20120510195
20120510198
20120510197
20120510197
20120510197
2012[10197
2012[10197
2012[10197
2012[10197
2012[10197
2012[10197
20120510198
20120510198
20120510198
20120510198
2012[10198
2012[10198
20120510195
20120510197
20120510197
2012[10198
20120510198
20120510198
20120510198

when data of the table is small, Probability of normal results was high. And error was disappeared in month field.
wrong:2012[10198---->right:20120510198

some issue or cause?
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB