Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3735#discussion_r111990633
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/codegen/CodeGenerator.scala
---
@@ -263,33 +263,56 @@ class CodeGenerator(
aggFields: Array[Array[Int]],
aggMapping: Array[Int],
fwdMapping: Array[(Int, Int)],
- outputArity: Int)
+ outputArity: Int,
+ groupingKeys: Array[Int])
: GeneratedAggregationsFunction = {
def genSetAggregationResults(
accTypes: Array[String],
aggs: Array[String],
aggMapping: Array[Int]): String = {
- val sig: String =
+ val sigHelper: String =
j"""
- | public void setAggregationResults(
- | org.apache.flink.types.Row accs,
- | org.apache.flink.types.Row output)""".stripMargin
+ | private final void setAggregationResultsHelper(
+ | org.apache.flink.types.Row accs,
+ | org.apache.flink.types.Row output,
+ | java.lang.Integer offset)""".stripMargin
- val setAggs: String = {
+ val setAggsHelper: String = {
for (i <- aggs.indices) yield
j"""
| org.apache.flink.table.functions.AggregateFunction
baseClass$i =
| (org.apache.flink.table.functions.AggregateFunction)
${aggs(i)};
|
| output.setField(
- | ${aggMapping(i)},
+ | ${aggMapping(i)} + offset,
--- End diff --
`${aggMapping(i)} + offset` -> `${aggMapping(i) + offset}` to add the
constant `offset` to the mapping before generating the code.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---