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-10008) Improve the LOG function in Table to support bases less than 1
Date Fri, 03 Aug 2018 15:39:00 GMT

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

ASF GitHub Bot commented on FLINK-10008:
----------------------------------------

xccui commented on a change in pull request #6465: [FLINK-10008] [table] Improve the LOG function
in Table to support bases less than 1
URL: https://github.com/apache/flink/pull/6465#discussion_r207561906
 
 

 ##########
 File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/functions/ScalarFunctions.scala
 ##########
 @@ -103,11 +103,13 @@ object ScalarFunctions {
     if (x <= 0.0) {
       throw new IllegalArgumentException(s"x of 'log(base, x)' must be > 0, but x = $x")
     }
-    if (base <= 1.0) {
-      throw new IllegalArgumentException(s"base of 'log(base, x)' must be > 1, but base
= $base")
-    } else {
-      Math.log(x) / Math.log(base)
+    if (base.compareTo(1.0) == 0) {
+      throw new IllegalArgumentException(s"base of 'log(base, x)' can not be 1")
+    }
+    if (base.compareTo(0.0) <= 0) {
 
 Review comment:
   Same as above.

----------------------------------------------------------------
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


> Improve the LOG function in Table to support bases less than 1
> --------------------------------------------------------------
>
>                 Key: FLINK-10008
>                 URL: https://issues.apache.org/jira/browse/FLINK-10008
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table API &amp; SQL
>            Reporter: Xingcan Cui
>            Assignee: Ruidong Li
>            Priority: Major
>              Labels: pull-request-available
>
> Currently, the {{LOG}} function in SQL/Table API restricts the base to be greater than
1. We should extend it to support bases less than 1 (e.g., {{LOG(0.1, 0.01)}} should return
2.0).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message