amaliujia commented on issue #1587: [CALCITE-3272] Support TUMBLE as Table 
Valued Function including an enumerable implementation, stream.iq and DESCRIPTOR
URL: https://github.com/apache/calcite/pull/1587#issuecomment-568799995
 
 
   @danny0405 
   I understand your concerns. Current implementation is less extensible as 
there will be more built-in table-valued function implementations and we cannot 
have many if-else with their own enumerable implementations.  An implementor 
interface would be desired for each implementation. 
   
   However, I believe current `CallImplementor` is not enough for table-valued 
functions. Table-valued functions cannot be done by the following code because 
at least it requires `inputPhysType`, and very likely require 
`outputPhysType`and others params.
   ```
   // RexCalls that are suitable for `CallImplementor`
   for (operand : call.operands())  {
      translate(operand);
   }
   
   translate(call, translatedOperands);
   ```  
   
   I think we need a new interface for this purpose, I have filed 
[CALCITE-3629](https://issues.apache.org/jira/browse/CALCITE-3629). 
   
   In this PR, I made some changes to move some Tumbling code to `EnumUtils`, 
per the existing practice of enumerables and not every line of code can be 
moved out. Meanwhile, I would suggest to solve 
[CALCITE-3629](https://issues.apache.org/jira/browse/CALCITE-3629) when I add 
`HOP` implementation (a work after this PR). The rationale is we need more 
implementations to build an abstraction and then which leads to a good 
interface design.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to