caicancai commented on code in PR #3732:
URL: https://github.com/apache/calcite/pull/3732#discussion_r1538391118
##########
core/src/main/java/org/apache/calcite/adapter/enumerable/RexImpTable.java:
##########
@@ -4127,14 +4130,14 @@ private static class LogicalNotImplementor extends
AbstractRexCallImplementor {
* <p>Handles all logarithm functions using log rules to determine the
* appropriate base (i.e. base e for LN).
*/
- private static class LogImplementor extends AbstractRexCallImplementor {
- LogImplementor() {
- super("log", NullPolicy.STRICT, true);
+ private static class LogImplementor extends MethodImplementor {
+ LogImplementor(Method method) {
+ super(method, NullPolicy.STRICT, true);
Review Comment:
@tanclary Hello
According to the extending AbstractRexCallImplementor at the beginning, we
need to identify different SQL dialects based on the "log" string, for example
```java
super("log", NullPolicy.STRICT, true);
```
But the problem is that we cannot identify all the dialects related to the
log function through a simple "log" string. We must use "logMySql" or The form
"logPostgres" identifies the corresponding SQL dialect, which means we need a
parameter.
Of course, it is also possible to pass a parameter through
AbstractRexCallImplementor, but we need to use a similar getName method to
determine whether it is "logMySql" or "LogPostrges". I think
BuiltInMethod.LOG.method already has this ability, we only need to identify the
method The methodName can be mapped to the corresponding SqlFunctions method
without the need to pass other parameters and make other judgments.
So I think this is a simpler and more efficient method.
You understand what I mean, thank you. I've been busy these days, so I'm
sorry for the late reply.
--
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]