You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Mehant Baid (JIRA)" <ji...@apache.org> on 2013/11/14 09:01:25 UTC

[jira] [Created] (DRILL-298) Extend Optiq's SqlOperatorTable to support Drill's custom functions

Mehant Baid created DRILL-298:
---------------------------------

             Summary: Extend Optiq's SqlOperatorTable to support Drill's custom functions
                 Key: DRILL-298
                 URL: https://issues.apache.org/jira/browse/DRILL-298
             Project: Apache Drill
          Issue Type: Bug
            Reporter: Mehant Baid
            Assignee: Mehant Baid


One approach is to implement DrillSqlOperatorTable which extends Optiq's ReflectiveSqlOperatorTable. Optiq has a notion of chained operator table with which we can simply add our specific operator table (DrillSqlOperatorTable) to its existing operator tables such that Optiq recognizes all functions defined in DrillSqlOperatorTable.

The main requirement of this task is to not have yet another set of declaration of functions, we want to automatically declare Drill's custom functions in a format understood by Optiq.

Below is the task breakdown:

1. Registering of drill functions should take place before we register Optiq's functions. (This can be done as part of the "thinning out the JDBC client" task)

2. Once we have a set of registered functions in Drill, we need to go through them and define them using Optiq's syntax (using SqlFunction() for example) 

3. Plugin DrillSqlOperatorTable into Optiq's ChainedSqlOperatorTable.

One minor challenge might be to get around the way ReflectiveSqlOperatorTable works. ReflectiveSqlOperatorTable gets all the fields defined in the derived class (all fields in the derived class are operators or functions that need to be registered, eg: SqlStdOperatorTable) and adds it to a Map which it uses later to verify if the function/ operator exists. We need to come up with a way to automatically define these fields so that ReflectiveSqlOperatorTable picks them up.





--
This message was sent by Atlassian JIRA
(v6.1#6144)