flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-10340) Add Cosh math function supported in Table API and SQL
Date Wed, 26 Sep 2018 13:16:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-10340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16628755#comment-16628755
] 

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_r220539663
 
 

 ##########
 File path: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarFunctionsTest.scala
 ##########
 @@ -996,6 +996,47 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
       math.sqrt(2.2).toString)
   }
 
+  @Test
+  def testCosh(): Unit = {
+    testAllApis(
+      0.cosh(),
+      "0.cosh()",
+      "COSH(0)",
+      math.cosh(0).toString
+    )
+
+    testAllApis(
+      -1.cosh(),
+      "-1.cosh()",
+      "COSH(-1)",
+      math.cosh(-1).toString
+    )
+
+    testAllApis(
+      'f6.cosh(),
+      "f6.cosh",
+      "COSH(f6)",
+      math.cosh(4.6D).toString)
+
+    testAllApis(
+      'f7.cosh(),
+      "f7.cosh",
+      "COSH(f7)",
+      math.cosh(3).toString)
+
+    testAllApis(
+      'f4.cosh(),
+      "f4.cosh",
+      "COSH(f4)",
+      math.cosh(44L).toString)
+
+    testAllApis(
+      'f22.cast(Types.DOUBLE).cosh(),
 
 Review comment:
   Why are you casting to double here? If so, what's the point of providing `COSH_DEC`?

----------------------------------------------------------------
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:
users@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 &amp; 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)

Mime
View raw message