You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "julianhyde (via GitHub)" <gi...@apache.org> on 2023/03/08 21:51:37 UTC

[GitHub] [calcite] julianhyde commented on a diff in pull request #3099: [CALCITE-5565] Implement BigQuery LOG Function

julianhyde commented on code in PR #3099:
URL: https://github.com/apache/calcite/pull/3099#discussion_r1130069345


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -473,6 +474,7 @@ Builder populate() {
       defineMethod(EXP, "exp", NullPolicy.STRICT);
       defineMethod(POWER, "power", NullPolicy.STRICT);
       defineMethod(LN, "ln", NullPolicy.STRICT);
+      defineMethod(LOG, "log", NullPolicy.STRICT);

Review Comment:
   Would this be simpler if done with an implementor that translates 'log(x, y)' to 'ln(x) / ln(y)'? Constant reduction could kick in, we could potentially optimize for bases such as e, 2, 10, and we would not need to add to `SqlFunctions`.
   
   Method implementor is kind of a hammer.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org