[GitHub] flink pull request #5638: [FLINK-6924][table]ADD LOG(X) supported in TableAP...
Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/5638 ---
[GitHub] flink pull request #5638: [FLINK-6924][table]ADD LOG(X) supported in TableAP...
Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/5638#discussion_r182104673 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala --- @@ -1130,4 +1130,13 @@ object concat_ws { } } +object log { + def apply(base: Expression, antilogarithm: Expression): Expression = { +Log(base, antilogarithm) + } + def apply(antilogarithm: Expression): Expression = { +new Log(antilogarithm) --- End diff -- We should go for `antilog.log(base)` for consistency with `antilog.ln()` and `antilog.log10()`. Since we need to inverse the parameters of the case class, we need to adapt the `ExpressionParser`. ---
[GitHub] flink pull request #5638: [FLINK-6924][table]ADD LOG(X) supported in TableAP...
Github user walterddr commented on a diff in the pull request: https://github.com/apache/flink/pull/5638#discussion_r175296949 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala --- @@ -1130,4 +1130,13 @@ object concat_ws { } } +object log { + def apply(base: Expression, antilogarithm: Expression): Expression = { +Log(base, antilogarithm) + } + def apply(antilogarithm: Expression): Expression = { +new Log(antilogarithm) --- End diff -- yup. I thought so too. Thanks for exploring all the possibilities ð ---
[GitHub] flink pull request #5638: [FLINK-6924][table]ADD LOG(X) supported in TableAP...
Github user buptljy commented on a diff in the pull request: https://github.com/apache/flink/pull/5638#discussion_r173897783 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala --- @@ -1130,4 +1130,13 @@ object concat_ws { } } +object log { + def apply(base: Expression, antilogarithm: Expression): Expression = { +Log(base, antilogarithm) + } + def apply(antilogarithm: Expression): Expression = { +new Log(antilogarithm) --- End diff -- 1. I've tried it before, but it seems that we can't restructure log(x) and ln(x) together because the expression in sql will be reflected directly as an instance of case class. Please let me know if you figure it out. 2. Actually we should use log(base, antilogarithm). ---
[GitHub] flink pull request #5638: [FLINK-6924][table]ADD LOG(X) supported in TableAP...
Github user walterddr commented on a diff in the pull request: https://github.com/apache/flink/pull/5638#discussion_r173607312 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala --- @@ -1130,4 +1130,13 @@ object concat_ws { } } +object log { + def apply(base: Expression, antilogarithm: Expression): Expression = { +Log(base, antilogarithm) + } + def apply(antilogarithm: Expression): Expression = { +new Log(antilogarithm) --- End diff -- nvm, I think it might be too weird to write something like `base.log(antilogarithm)` in table API. ---
[GitHub] flink pull request #5638: [FLINK-6924][table]ADD LOG(X) supported in TableAP...
Github user walterddr commented on a diff in the pull request: https://github.com/apache/flink/pull/5638#discussion_r173606447 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala --- @@ -1130,4 +1130,13 @@ object concat_ws { } } +object log { + def apply(base: Expression, antilogarithm: Expression): Expression = { +Log(base, antilogarithm) + } + def apply(antilogarithm: Expression): Expression = { +new Log(antilogarithm) --- End diff -- Is it just `new Ln(antilogarithm)`, we might be able to restructure them together? ---
[GitHub] flink pull request #5638: [FLINK-6924][table]ADD LOG(X) supported in TableAP...
GitHub user buptljy opened a pull request: https://github.com/apache/flink/pull/5638 [FLINK-6924][table]ADD LOG(X) supported in TableAPI ## What is the purpose of the change * Add LOG(X) function in TableAPI. ## Brief change log * Add LOG(X) function in TableAPI. * Modify LOG(X) unit tests from "testSqlApi" to "testAllApis". ## Verifying this change * This can be tested by unit testing. ## Does this pull request potentially affect one of the following parts: * No ## Documentation * You can merge this pull request into a Git repository by running: $ git pull https://github.com/buptljy/flink log Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/5638.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #5638 commit 376cee8a6bc25afdf8df50b65c3fa8f35a5e4b7c Author: Liao Jiayi Date: 2018-03-04T09:15:10Z add log table function commit 9ab7a07c0b614cb7af0fee7e69f6d58bf5004b28 Author: Liao Jiayi Date: 2018-03-04T09:15:23Z Merge branch 'master' of github.com:apache/flink into log ---