Vladsz83 commented on code in PR #11478: URL: https://github.com/apache/ignite/pull/11478#discussion_r1725224650
########## modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java: ########## @@ -2205,76 +2220,86 @@ private static class LogicalNotImplementor extends AbstractRexCallImplementor { } } - /** - * Implementation that calls a given {@link Method}. + /** Implementor for the {@code LN}, {@code LOG}, and {@code LOG10} operators. * - * <p>When method is not static, a new instance of the required class is - * created. + * <p>Handles all logarithm functions using log rules to determine the + * appropriate base (i.e. base e for LN). */ - private static class ReflectiveImplementor extends AbstractRexCallImplementor { - /** */ - protected final Method method; - + private static class LogImplementor extends AbstractRexCallImplementor { /** */ - ReflectiveImplementor(Method method, NullPolicy nullPolicy) { - super("reflective_" + method.getName(), nullPolicy, false); - this.method = method; + LogImplementor() { + super("log", NullPolicy.STRICT, true); } /** {@inheritDoc} */ - @Override Expression implementSafe(RexToLixTranslator translator, - RexCall call, List<Expression> argValueList) { - List<Expression> argValList0 = ConverterUtils.fromInternal(method.getParameterTypes(), argValueList); - if ((method.getModifiers() & Modifier.STATIC) != 0) - return Expressions.call(method, argValList0); + @Override Expression implementSafe(final RexToLixTranslator translator, + final RexCall call, final List<Expression> argValueList) { + return Expressions.call(BuiltInMethod.LOG.method, args(call, argValueList)); + } - // The UDF class must have a public zero-args constructor. - // Assume that the validator checked already. - final Expression target = Expressions.new_(method.getDeclaringClass()); - return Expressions.call(target, method, argValList0); + /** */ + private static List<Expression> args(RexCall call, + List<Expression> argValueList) { Review Comment: Can be placed on the previous line -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org