caicancai commented on code in PR #3732:
URL: https://github.com/apache/calcite/pull/3732#discussion_r1525039710
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -4146,9 +4149,52 @@ private static List<Expression> args(RexCall call,
if (argValueList.size() == 2) {
return list.append(argValueList.get(1));
}
+ if (argValueList.size() == 1) {
+ return list.append(Expressions.constant(Math.exp(1)));
+ }
+ // fall through
+ case "LN":
+ return list.append(Expressions.constant(Math.exp(1)));
+ case "LOG10":
+ return list.append(Expressions.constant(BigDecimal.TEN));
+ default:
+ throw new AssertionError("Operator not found: " + call.getOperator());
+ }
+ }
+ }
+
+ /** Implementor for the {@code LN}, {@code LOG}, and {@code LOG10} operators.
+ *
+ * <p>Handles all logarithm functions using log rules to determine the
+ * appropriate base (i.e. base e for LN).
+ */
+ private static class LogMSImplementor extends AbstractRexCallImplementor {
+ LogMSImplementor() {
+ super("logMS", NullPolicy.STRICT, true);
+ }
+
+ @Override Expression implementSafe(final RexToLixTranslator translator,
+ final RexCall call, final List<Expression> argValueList) {
+ return Expressions.call(BuiltInMethod.LOGMS.method, args(call,
argValueList));
+ }
+
+ private static List<Expression> args(RexCall call,
Review Comment:
remove
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]