Details
-
New Feature
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
Description
Converting the `RelNode` with `SqlWindowTableFunction` will fail with exception:
For example the employee table:
Column | Type |
-----------+-------------------------------
id | integer |
salary | double precision |
hire_rate | timestamp(0) without time zone |
and the sql:
SELECT * FROM TABLE(TUMBLE(TABLE employee, DESCRIPTOR(hire_date), INTERVAL '1' MINUTE))
Conver it to RelNode like this:
LogicalProject | | -- inputs: <----------- | |--- LogicalTableScan | | | |-- RexCall: | | |- op: SqlWindowFunction | | |- operands: [DESCRIPTOR(INPUT_REF(2)), INTERVAL] | |--- fieldList [`id`, `salary`, `hire_date`, `window_start`, `window_end`]
When convert the RelNode to SqlNode, the operand( INPUT_REF(2)) of operator `DESCRIPTOR` incorrectly refers to the RelNode (TableScan) in current implemention, it should refer to input rows:
LogicalProject |- | -- inputs: | |--- LogicalTableScan | |-- RexCall: | |- op: SqlWindowFunction | |- operands: [DESCRIPTOR(INPUT_REF(2)), INTERVAL] | | | | | \/ |--- fieldList [`id`, `salary`, `hire_date`, `window_start`, `window_end`]