[
https://issues.apache.org/jira/browse/FLINK-7126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16081139#comment-16081139
]
ASF GitHub Bot commented on FLINK-7126:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/4279#discussion_r126534907
--- Diff:
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/sql/AggregationsTest.scala
---
@@ -39,4 +40,42 @@ class AggregationsTest extends TableTestBase {
streamUtil.tEnv.sql(sqlQuery)
}
+
+ @Test
+ def testDistinct(): Unit = {
+ val sql = "SELECT DISTINCT a, b, c FROM MyTable"
+
+ val expected =
+ unaryNode(
+ "DataStreamGroupAggregate",
+ streamTableNode(0),
+ term("groupBy", "a, b, c"),
+ term("select", "a, b, c")
+ )
+ streamUtil.verifySql(sql, expected)
+ }
+
+ @Test
+ def testDistinctAfterAggregate(): Unit = {
+ val sql = "SELECT DISTINCT a FROM MyTable GROUP BY a, b, c"
+
+ val expected =
+ unaryNode(
+ "DataStreamGroupAggregate",
--- End diff --
Shouldn't this query be optimized to only have a single
`DataStreamGroupAggregate`? @wuchong can you check this and open a JIRA if this
is the case? Thank you
> Support Distinct for Stream SQL and Table API
> ---------------------------------------------
>
> Key: FLINK-7126
> URL: https://issues.apache.org/jira/browse/FLINK-7126
> Project: Flink
> Issue Type: Bug
> Components: Table API & SQL
> Affects Versions: 1.4.0
> Reporter: Jark Wu
> Assignee: Jark Wu
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)