Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/3694#discussion_r110340764 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/CodeGenerator.scala --- @@ -403,6 +403,41 @@ class CodeGenerator( | }""".stripMargin } + def generateMergeTwoRows( + accTypes: Array[String], + aggs: Array[String]): String = { + + val sig: String = + j""" + | public org.apache.flink.types.Row mergeTwoRows( + | org.apache.flink.types.Row a, + | org.apache.flink.types.Row b) + | """.stripMargin + val merge: String = { + for (i <- aggs.indices) yield + j""" + | ${accTypes(i)} aAcc$i = (${accTypes(i)}) a.getField($i); + | ${accTypes(i)} bAcc$i = (${accTypes(i)}) b.getField($i); + | java.util.ArrayList<${accTypes(i)}> accumulators$i --- End diff -- Can we create a reusable list for each aggregation function?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---