[ https://issues.apache.org/jira/browse/FLINK-10340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16631641#comment-16631641 ]
ASF GitHub Bot commented on FLINK-10340: ---------------------------------------- pnowojski commented on a change in pull request #6700: [FLINK-10340][table] Add Cosh math function supported in Table API and SQL URL: https://github.com/apache/flink/pull/6700#discussion_r221201513 ########## File path: docs/dev/table/functions.md ########## @@ -1274,6 +1274,17 @@ ATAN2(numeric1, numeric2) </td> </tr> + <tr> + <td> + {% highlight text %} +COSH(numeric) +{% endhighlight %} + </td> + <td> + <p>Returns the hyperbolic cosine of <i>numeric</i>. Return value type is DOUBLE.</p> Review comment: 1. in that case I would suggest <i>DOUBLE</i> and <i>NUMERIC</i>. @yanghua could you make sure that the doc page renders correctly (`./build_docs.sh -i` script in `docs` directory allows you to run the docs locally). 2. https://ci.apache.org/projects/flink/flink-docs-master/dev/table/sql.html#data-types here the types are in capital letter, however I don't mind either way. 3. Unfortunately this is either hard, or impossible: a) some functions can not be implemented returning accurate `DECIMAL`, like most of the math functions (`cos`, `sqrt`, `log`, `ln`, ....). b) some function require extra time and effort. Like specialised version of `power(DECIMAL, INT)` could return precise `DECIMAL`, while `power(INT, DECIMAL)` can not. I think the (most?) popular convention in SQL is to return `DOUBLE` if the result is not precise, to avoid silent precision losses. But correct `DECIMAL` handling is generally speaking bigger topic to sort out in Flink in the future. For example I do not like that we provide functions like `DOUBLE COS(DECIMAL)`, because this also gives an opportunity to semi silent precision losses. However regardless of that, letting user know whether the function returns precise or approximate result is must have (vide non obvious case of `POWER(2.5, 2)`). Also letting user know what's the return type of the function is also important. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Add Cosh math function supported in Table API and SQL > ----------------------------------------------------- > > Key: FLINK-10340 > URL: https://issues.apache.org/jira/browse/FLINK-10340 > Project: Flink > Issue Type: Sub-task > Components: Table API & SQL > Affects Versions: 1.6.0 > Reporter: Sergey Tsvetkov > Assignee: vinoyang > Priority: Minor > Labels: pull-request-available > > Implement udf of cosh, just like in oracle > [https://docs.oracle.com/cd/B28359_01/server.111/b28286/functions031.htm#SQLRF00623] > -- This message was sent by Atlassian JIRA (v7.6.3#76005)