Return-Path: X-Original-To: apmail-drill-dev-archive@www.apache.org Delivered-To: apmail-drill-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A175E18CCB for ; Wed, 16 Mar 2016 22:26:30 +0000 (UTC) Received: (qmail 16574 invoked by uid 500); 16 Mar 2016 22:26:30 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 16520 invoked by uid 500); 16 Mar 2016 22:26:30 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 16507 invoked by uid 99); 16 Mar 2016 22:26:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Mar 2016 22:26:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 15EB0DFBD5; Wed, 16 Mar 2016 22:26:30 +0000 (UTC) From: sudheeshkatkam To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request: Drill 4372 review Content-Type: text/plain Message-Id: <20160316222630.15EB0DFBD5@git1-us-west.apache.org> Date: Wed, 16 Mar 2016 22:26:30 +0000 (UTC) Github user sudheeshkatkam commented on a diff in the pull request: https://github.com/apache/drill/pull/397#discussion_r56426901 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillOperatorTable.java --- @@ -26,34 +33,88 @@ import org.apache.calcite.sql.SqlOperatorTable; import org.apache.calcite.sql.SqlSyntax; import org.apache.calcite.sql.fun.SqlStdOperatorTable; +import org.apache.drill.exec.planner.physical.PlannerSettings; +import org.apache.drill.exec.server.options.SystemOptionManager; import java.util.List; +import java.util.Map; +/** + * Implementation of {@link SqlOperatorTable} that contains standard operators and functions provided through + * {@link #inner SqlStdOperatorTable}, and Drill User Defined Functions. + */ public class DrillOperatorTable extends SqlStdOperatorTable { - static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillOperatorTable.class); - +// private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(DrillOperatorTable.class); private static final SqlOperatorTable inner = SqlStdOperatorTable.instance(); - private List operators; - private ArrayListMultimap opMap = ArrayListMultimap.create(); + private final List operatorsCalcite = Lists.newArrayList(); + private final List operatorsDefault = Lists.newArrayList(); + private final List operatorsInferernce = Lists.newArrayList(); + private final Map calciteToWrapper = Maps.newIdentityHashMap(); + + private final ArrayListMultimap opMapDefault = ArrayListMultimap.create(); + private final ArrayListMultimap opMapInferernce = ArrayListMultimap.create(); + + private final SystemOptionManager systemOptionManager; public DrillOperatorTable(FunctionImplementationRegistry registry) { - operators = Lists.newArrayList(); - operators.addAll(inner.getOperatorList()); + this(registry, null); + } + public DrillOperatorTable(FunctionImplementationRegistry registry, SystemOptionManager systemOptionManager) { registry.register(this); + operatorsCalcite.addAll(inner.getOperatorList()); + populateWrappedCalciteOperators(); + this.systemOptionManager = systemOptionManager; + } + + public void addDefault(String name, SqlOperator op) { --- End diff -- From names, the functionality of addDefault and addInference is not obvious. Please add docs to these methods and class, since implementations of pluggable function registry have to use these methods. --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---