Repository: flink Updated Branches: refs/heads/tableOnCalcite 4a63e2914 -> e097cf7db
[FLINK-3502] Add test case. Bug was resolved by a previous commit. Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/e097cf7d Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/e097cf7d Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/e097cf7d Branch: refs/heads/tableOnCalcite Commit: e097cf7dbbeec6ecbd77e77842c1c869ae40de1b Parents: 4a63e29 Author: Fabian Hueske <fhue...@apache.org> Authored: Fri Feb 26 15:53:19 2016 +0100 Committer: Fabian Hueske <fhue...@apache.org> Committed: Fri Feb 26 15:53:19 2016 +0100 ---------------------------------------------------------------------- .../table/test/GroupedAggregationsITCase.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/e097cf7d/flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/table/test/GroupedAggregationsITCase.scala ---------------------------------------------------------------------- diff --git a/flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/table/test/GroupedAggregationsITCase.scala b/flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/table/test/GroupedAggregationsITCase.scala index a88abcb..062967d 100644 --- a/flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/table/test/GroupedAggregationsITCase.scala +++ b/flink-libraries/flink-table/src/test/scala/org/apache/flink/api/scala/table/test/GroupedAggregationsITCase.scala @@ -137,4 +137,21 @@ class GroupedAggregationsITCase(mode: TestExecutionMode) extends MultipleProgram TestBaseUtils.compareResultAsText(results.asJava, expected) } + + @Test + def testGroupedByExpression2(): Unit = { + + // verify AggregateProjectPullUpConstantsRule + + val env = ExecutionEnvironment.getExecutionEnvironment + val t = CollectionDataSets.get3TupleDataSet(env).as('a, 'b, 'c) + .select('b, 4 as 'four, 'a) + .groupBy('b, 'four) + .select('four, 'a.sum) + + val expected = "4,1\n" + "4,5\n" + "4,15\n" + "4,34\n" + "4,65\n" + "4,111\n" + val results = t.toDataSet[Row].collect() + + TestBaseUtils.compareResultAsText(results.asJava, expected) + } }