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 15:54:50 UTC
[flink] branch release-1.6 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.6
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.6 by this push:
new 80964d2 [FLINK-9935] [table] Fix incorrect group field access in batch window combiner.
80964d2 is described below
commit 80964d27ad3518c1df02c8f8aa8be5bee22490b4
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 7ce44a6..a3c9c1e 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
@@ -586,7 +586,7 @@ object AggregateUtil {
isDistinctAggs,
isStateBackedDataViews = false,
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)