Dear Julian, thanks for the hint, I will have a deeper look to See if TableMacro is more suitable for us.
Basically what we try to do currently is to use Calcite to provide a "Database-Like" Framework for the access to our evaluation system. There we have User defined Evaluation Functions (that take Arguments) that produce a (complex) structure that can be mapped to one or more tables. Thus, if a user requests some data from a Calcite Table (i.e. the scan is called) we know which evaluations to start to produce the data for the user. What's left is to create Rules to Combine all calls to our "virtual" Tables together to know which evaluations have to be done. My Idea was to do this with our Custom CallingConvention. But this should all work when using TableMacros, I think. So the only difference to the TableFunctions is that we have to know the Result Type in advance, is this right? Thanks! Julian ----- Ursprüngliche Mail ----- Von: "Julian Hyde" <[email protected]> An: "dev" <[email protected]> Gesendet: Sonntag, 8. Januar 2017 22:12:11 Betreff: Re: Register ConversionRule for LogicalTableFunctionScan You seem to have in mind some functionality that exists in Table that you would like replicated in TableFunction. Can you describe the Table functionality? Are you aware of TableMacro? Maybe it is a bit more “plannable”. Julian > On Jan 5, 2017, at 8:05 AM, Julian Feinauer <[email protected]> > wrote: > > Dear Folks, > > > > I am currently working a lot with TableFunctions. > > To get a bit more “freedom” about how the TableFunctions are called and when > I wanted to use a ConversionRule to convert the LogicalTableFunctionScan to > my custom CallingConvention (Similar to EnumerableTableFunctionScanRule, see > [1]). > > > > But it seems not so easy to register the necessary Rule because I have no > instance of an AbstractRelNode that is loaded and hence no “register” > function that is called. > > > > My Schema consists only of TableFunctions and it seems “hackish” to add a > Table or something else that registers my ConversionRules. > > I see no way to “define” my TableFunctionScans as they are created by the > Parser as LogicalTableFunctionScans and I see no way to “define” them > directly. > > The Connection is instantiated based on an json model (and a custom > SchemaFactory). > > > > Are there any other ideas / possibilities to register ConversionRules in a > Connection / Schema that is created via a json model and consist only on > TableFunctions. > > Or to “define” the TableFunctionScan directly in the Schema? > > > > Thanks already! > > Julian > > > > [1] > https://github.com/apache/calcite/blob/0938c7b6d767e3242874d87a30d9112512d9243a/core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableTableFunctionScanRule.java > > >
