dianfu commented on a change in pull request #7286: [FLINK-8739] [table] 
Optimize DISTINCT aggregates to use the same distinct accumulator if possible
URL: https://github.com/apache/flink/pull/7286#discussion_r248148152
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/harness/HarnessTestBase.scala
 ##########
 @@ -553,6 +384,20 @@ class HarnessTestBase extends StreamingWithStateTestBase {
     stateField.get(generatedAggregation).asInstanceOf[DataView]
   }
 
+  def getGeneratedAggregationFields(
+      operator: AbstractUdfStreamOperator[_, _],
+      funcName: String,
+      funcClass: Class[_]): Array[Field] = {
+    val function = funcClass.getDeclaredField(funcName)
+    function.setAccessible(true)
+    val generatedAggregation =
+      
function.get(operator.getUserFunction).asInstanceOf[GeneratedAggregations]
 
 Review comment:
   Yes, we should have such test cases and there are such kind of check in 
GroupAggregateHarnessTest.testDistinctAggregateWithRetract and 
GroupAggregateHarnessTest.testDistinctAggregateWithDifferentArgumentOrder 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to