Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-22455

FlinkRelBuilder#windowAggregate will throw ClassCastException when function reuse

    XMLWordPrintableJSON

Details

    Description

      If the input parameter aggCalls of FlinkRelBuilder#windowAggregate contains the same aggregate function. Then it will throw ClassCastException, because of the optimization of aggregate function reuse. We did not judge the return value type, but direct type conversion;

          val aggregate = super.transform(
            new UnaryOperator[RelBuilder.Config] {
              override def apply(t: RelBuilder.Config)
                : RelBuilder.Config = t.withPruneInputOfAggregate(false)
            })
            .push(build())
            .aggregate(groupKey, aggCalls)
            .build()
            .asInstanceOf[LogicalAggregate]
      

      I wrote a test that triggered this problem.
      You can use the attached code to reproduce this problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tartarus tartarus
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: