Github user hsuanyi commented on a diff in the pull request: https://github.com/apache/drill/pull/397#discussion_r54787960 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillSqlOperator.java --- @@ -18,69 +18,43 @@ package org.apache.drill.exec.planner.sql; -import com.google.common.base.Preconditions; -import org.apache.drill.common.types.TypeProtos.MajorType; -import org.apache.drill.common.types.TypeProtos.MinorType; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlCall; +import java.util.ArrayList; +import java.util.List; + import org.apache.calcite.sql.SqlFunction; import org.apache.calcite.sql.SqlFunctionCategory; import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlOperatorBinding; import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql.validate.SqlValidatorScope; +import org.apache.drill.exec.expr.fn.DrillFuncHolder; public class DrillSqlOperator extends SqlFunction { - static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillSqlOperator.class); - - private static final MajorType NONE = MajorType.getDefaultInstance(); - private final MajorType returnType; + // static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillSqlOperator.class); private final boolean isDeterministic; + private final List<DrillFuncHolder> functions; public DrillSqlOperator(String name, int argCount, boolean isDeterministic) { - this(name, argCount, MajorType.getDefaultInstance(), isDeterministic); + this(name, new ArrayList<DrillFuncHolder>(), argCount, argCount, isDeterministic); --- End diff -- This constructor exists for the legacy reason. In theory, if Drill needs a DrillSqlOperator, it is supposed to go to DrillOperatorTable for pickup. However, I think it is because Drill cannot access to DrillOperatorTable at the place where this constructor is being called. An example can be found in [1]. (Note rexBuilder.getOpTab() will only give calcite's SqlStdOperatorTable) [1] https://github.com/apache/drill/blob/d7eebec41a1636055be1b2c79b693d76c52d8932/exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java#L240
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---