sunjincheng121 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_r248129709
 
 

 ##########
 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:
   Can we add a test case that check is the member variable of the test 
`GeneratedAggregations meeting the expectations? i.e: check the number of test 
variables or `NonWindowedAggregationHelper` which named 
`acc[Num]_distinctValueMap_dataview` ?

----------------------------------------------------------------
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