Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3271 Table-valued function windowing and EMIT syntax support in Calcite
  3. CALCITE-3343

Improve LogicalTableFunctionScan to match table function windowing

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • None
    • None

    Description

      https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableFunctionScan.java#L40

        /**
         * Creates a <code>LogicalTableFunctionScan</code>.
         *
         * @param cluster        Cluster that this relational expression belongs to
         * @param inputs         0 or more relational inputs
         * @param traitSet       Trait set
         * @param rexCall        Function invocation expression
         * @param elementType    Element type of the collection that will implement
         *                       this table
         * @param rowType        Row type produced by function
         * @param columnMappings Column mappings associated with this function
         */
        public LogicalTableFunctionScan(
            RelOptCluster cluster,
            RelTraitSet traitSet,
            List<RelNode> inputs,
            RexNode rexCall,
            Type elementType, 
             RelDataType rowType,
            Set<RelColumnMapping> columnMappings) {
          super(cluster, traitSet, inputs, rexCall, elementType, rowType,
              columnMappings);
        }
      

      There might be a gap to make LogicalTableFunctionScan work for table function windowing:
      1. we need a RexInputRef parameter (converted from the DESCRIPTOR) to mark which column is the watermarked column.

      2. we need a List of RexNode(RexLiteral) for interval parameters.

      The most straightforward approach while maintaining backward compatible, seems is add another constructor with an additional List<RexNode> parameter. We could save RexInputRef and intervals (RexLiteral) to this parameter.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: