Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill >> mail # dev >> RE:  [jira] [Commented] (DRILL-247) New Math Functions: log, sqrt, cbrt, rand, round, exp, e, pi, pow

Copy link to this message
Re: [jira] [Commented] (DRILL-247) New Math Functions: log, sqrt, cbrt, rand, round, exp, e, pi, pow
I'm worried about "e". In SQL, functions with zero parameters are called without parentheses. Thus a query like

  select e.empid from emps as e

might be ambiguous. Anyone who has a real need to use e in their queries will also know that they can write exp(1.0).

I'd start from the SQL standard and the longer established databases (especially Oracle and Postgres) rather than Pig and Hive. Less chance of - ahem - innovative specifications that are incompatible with people's expectations.

There is a long list of operator tests in Optiq's SqlOperatorBaseTest.java [ https://github.com/julianhyde/optiq/blob/master/core/src/test/java/org/eigenbase/sql/test/SqlOperatorBaseTest.java ]. They check parsing, validation, return type derivation, and null handling, as well as that the functions give the right answer. The operators are drawn mainly from the SQL standard, but there are some from Oracle. It's worth sub-classing that test and calling from Drill.


On Sep 21, 2013, at 8:43 AM, Yash Sharma <[EMAIL PROTECTED]> wrote:

> Am picking from Hive and Pig function list.
> Sent from my Sony Xperia™ smartphone
> "Ted Dunning (JIRA)" <[EMAIL PROTECTED]> wrote:
>    [ https://issues.apache.org/jira/browse/DRILL-247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13773839#comment-13773839 ]
> Ted Dunning commented on DRILL-247:
> -----------------------------------
> yash,
> What reference are you using for picking functions and names?
> It might be nice to find names common to, say, Oracle, Postgres and Sequel Server.
>> New Math Functions: log, sqrt, cbrt, rand, round, exp, e, pi, pow
>> -----------------------------------------------------------------
>>                Key: DRILL-247
>>                URL: https://issues.apache.org/jira/browse/DRILL-247
>>            Project: Apache Drill
>>         Issue Type: Improvement
>>           Reporter: Yash Sharma
>> Improving the math functions collection with more functions:
>> log(a): the natural logarithm (base e) of an expression
>> log10(a): base 10 logarithm
>> sqrt(a): square root
>> cbrt(a): cube root
>> rand(): returns random number from 0-1.
>> round(a)
>> exp(a): exponential e^a
>> e(): returns value of e
>> pi(): returns value of pi
>> pow(a, p): returns a^p
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators
> For more information on JIRA, see: http://www.atlassian.com/software/jira
> ________________________________
> NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.