Oliver Lee created CALCITE-5982:
-----------------------------------

             Summary: Allow overloading the created enumerable in Calcite when 
calling getTables() or getColumns() 
                 Key: CALCITE-5982
                 URL: https://issues.apache.org/jira/browse/CALCITE-5982
             Project: Calcite
          Issue Type: New Feature
            Reporter: Oliver Lee
            Assignee: Oliver Lee


The goal is to introduce a mechanism that allows overloading the enumerable 
type that is created when {{getTables()}} and {{getColumns()}} is called. If a 
user provides an overloaded {{{}MetaTable{}}}/ {{MetaColumn}} class, then they 
can add in additional metadata fields that they would like to be transferred. 
 
Currently, {{CalciteMetaImpl}} in {{getTables()}} and {{getColumns()}} calls 
are hardcoded to do reflection on {{MetaTable.class}} and {{MetaColumn.class}} 
‘ fields, matched with the list of column names that are passed in. Reflection 
is important here, as it creates the proper {{ColumnMetaData}} and 
{{Signature}} that the client needs to deserialize. 
See here for {{[getTables()|#L270]]}} and here for 
[{{getColumns()}}|https://github.com/apache/calcite/blob/164ff0a27e243850d294908dc5cff90760d0a35a/core/src/main/java/org/apache/calcite/jdbc/CalciteMetaImpl.java#L320]
 
 
I would like to introduce fields ( {{metaTableClass}} , {{metaColumnClass}} ) 
on {{CalciteMetaImpl}} that determine which class to use for each of these. 
This will be configured as a {{CalciteConnectionProperty}} when making the 
{{jdbc:calcite}} connection
 
 
Requirements:
 * User can specify in {{Properties}} new {{CalciteConnectionProperty}} ’s to 
specify which overloaded class of {{CalciteMetaTable}} and {{MetaColumn}} to use
 * If not specified, it will default to {{CalciteMetaTable.class}} and 
{{MetaColumn.class}}

 
 
 
The provided overloaded class will create a subclass of {{CalciteMetaTable}} / 
{{MetaColumn}} that has the same shape constructor and also provide an override 
for the function {{{}getColumnNames(){}}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to