Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.22.0
    • None
    • None

    Description

      The current implementation of TUMBLE is the following:

      if (isTumble()) {
         // create expressions and blockstatement
      } else {
       // other table function scan enumerable implementation.
      }
      

      This style is less extensible. We will add more builtin table-valued function implementation and we shouldn't add more if-else with complicated implementation.

      A better practice is in RexImpTable, each operator register its implementor, and then the code will be becomes:

      if (implementor defined) {
         return implementor.implement(...)
      }  else {
       // default table function scan enumerable implementation for those that does not have implementor.
      } 
      

      The current implementor[1] or [2] is not enough for table-valued function as table-valued function need both inputPhysType and outPhysType, and potential other params to implement itself.

      Another condition is we might need more table-valued function implementations to abstract a common interface.

      [1]: https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/adapter/enumerable/CallImplementor.java#L38
      [2]: https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/adapter/enumerable/NotNullImplementor.java

      Attachments

        Activity

          People

            amaliujia Rui Wang
            amaliujia Rui Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: