The RelNode's digest (AbstractRelNode.getDigest()), along with its RowType, is used by the Calcite HepPlanner to avoid adding duplicate Vertices to the graph. If an equivalent vertex is already present in the graph, then that vertex is used in place of the newly generated one:
This means that the digest needs to contain all the information necessary to identify a vertex and distinguish it from similar - but not equivalent - vertices.
In the case of `LogicalWindowAggregation` and `FlinkLogicalWindowAggregation`, the window specs are currently not in the digest, meaning that two aggregations with the same signatures and expressions but different windows are considered equivalent by the planner, which is not correct and will lead to an invalid Physical Plan.
For instance, the following query would give an invalid plan:
The invalid plan generated by the planner is the following (Please note the windows in the two DataStreamGroupWindowAggregates nodes being the same when they should be different):