You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by fh...@apache.org on 2018/07/26 16:25:13 UTC
[flink] branch release-1.4 updated: [FLINK-9935] [table] Fix
incorrect group field access in batch window combiner.
This is an automated email from the ASF dual-hosted git repository.
fhueske pushed a commit to branch release-1.4
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.4 by this push:
new c5223fd [FLINK-9935] [table] Fix incorrect group field access in batch window combiner.
c5223fd is described below
commit c5223fdecdc8ef5889609bebfd7e259600a2179a
Author: Fabian Hueske <fh...@apache.org>
AuthorDate: Wed Jul 25 17:04:30 2018 +0200
[FLINK-9935] [table] Fix incorrect group field access in batch window combiner.
---
.../scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala | 2 +-
.../org/apache/flink/table/runtime/batch/table/GroupWindowITCase.scala | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala
index 74b79e6..f4eea0a 100644
--- a/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala
+++ b/flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala
@@ -561,7 +561,7 @@ object AggregateUtil {
aggFieldIndexes,
aggMapping,
partialResults = true,
- groupings,
+ groupings.indices.toArray,
Some(aggregates.indices.map(_ + groupings.length).toArray),
outputType.getFieldCount,
needRetract,
diff --git a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/table/GroupWindowITCase.scala b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/table/GroupWindowITCase.scala
index 3d9223e..2c984c1 100644
--- a/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/table/GroupWindowITCase.scala
+++ b/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/batch/table/GroupWindowITCase.scala
@@ -97,6 +97,7 @@ class GroupWindowITCase(
val table = env
.fromCollection(data)
.toTable(tEnv, 'long, 'int, 'double, 'float, 'bigdec, 'string)
+ .select('int, 'long, 'string) // keep this select to enforce that the 'string key comes last
val windowedTable = table
.window(Tumble over 5.milli on 'long as 'w)
@@ -271,6 +272,7 @@ class GroupWindowITCase(
val table = env
.fromCollection(data)
.toTable(tEnv, 'long, 'int, 'double, 'float, 'bigdec, 'string)
+ .select('int, 'long, 'string) // keep this select to enforce that the 'string key comes last
val windowedTable = table
.window(Slide over 10.milli every 5.milli on 'long as 'w)