You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Rui Wang (Jira)" <ji...@apache.org> on 2019/09/13 18:25:00 UTC

[jira] [Updated] (CALCITE-3343) Improve LogicalTableFunctionScan to match table function windowing

     [ https://issues.apache.org/jira/browse/CALCITE-3343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rui Wang updated CALCITE-3343:
------------------------------
    Description: 
https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableFunctionScan.java#L40

{code:java}
  /**
   * 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);
  }
{code}

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. 


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

{code:java}
  /**
   * 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);
  }
{code}

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 internals (RexLiteral) to this parameter. 



> Improve LogicalTableFunctionScan to match table function windowing
> ------------------------------------------------------------------
>
>                 Key: CALCITE-3343
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3343
>             Project: Calcite
>          Issue Type: Sub-task
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>
> https://github.com/apache/calcite/blob/master/core/src/main/java/org/apache/calcite/rel/logical/LogicalTableFunctionScan.java#L40
> {code:java}
>   /**
>    * 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);
>   }
> {code}
> 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. 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)