hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Dere (JIRA)" <>
Subject [jira] [Commented] (HIVE-6327) A few mathematic functions don't take decimal input
Date Thu, 30 Jan 2014 23:12:12 GMT


Jason Dere commented on HIVE-6327:

In general though, this is not true: we cannot just treat decimal as double in every case.

Is this true? I thought the point of FunctionRegistry.getMethodInternal() was to find best
matching method signature given the arguments, while doing type conversion if necessary. 
I would think that double/decimal would be a good match for one another, if there isn't a
signature that matches the param exactly.

> A few mathematic functions don't take decimal input
> ---------------------------------------------------
>                 Key: HIVE-6327
>                 URL:
>             Project: Hive
>          Issue Type: Improvement
>    Affects Versions: 0.11.0, 0.12.0
>            Reporter: Xuefu Zhang
>            Assignee: Xuefu Zhang
> A few mathematical functions, such as sin() cos(), etc. don't take decimal as argument.
> {code}
> hive> show tables;
> OK
> Time taken: 0.534 seconds
> hive> create table test(d decimal(5,2));
> OK
> Time taken: 0.351 seconds
> hive> select sin(d) from test;
> FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments 'd': No matching method
for class org.apache.hadoop.hive.ql.udf.UDFSin with (decimal(5,2)). Possible choices: _FUNC_(double)
> {code}
> HIVE-6246 covers only sign() function. The remaining ones, including sin, cos, tan, asin,
acos, atan, exp, ln, log, log10, log2, radians, and sqrt. These are non-generic UDFs.

This message was sent by Atlassian JIRA

View raw message