walterddr commented on a change in pull request #6521: [FLINK-5315][table] 
Adding support for distinct operation for table API on DataStream
URL: https://github.com/apache/flink/pull/6521#discussion_r208624881
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/scala/expressionDsl.scala
 ##########
 @@ -214,10 +214,16 @@ trait ImplicitExpressionOperations {
   def varSamp = VarSamp(expr)
 
   /**
-    *  Returns multiset aggregate of a given expression.
+    * Returns multiset aggregate of a given expression.
     */
   def collect = Collect(expr)
 
+  /**
+    * Return a distinct field reference to a given expression
+    * @return
+    */
+  def distinct = DistinctAgg(expr)
 
 Review comment:
   This is the particular places I would like to have 2nd opinion on. I thought 
of 2 ways of doing this: 
   1. the way I did, adding distinct in `ExpressionDsl.scala`, and treate 
`distinct` as a special Aggregation; separately having a `distinct` method in 
`AggregationFunction` class for UDAGG.
   2. adding distinct into `ExpressionParser.scala` and create special prefix / 
suffix rules to handle distinct modifier with different expression converter.
   
   I prefer the 1st way, since the 2nd way requires unifying the parsing for 
both `distinct` in agg and `distinct` in table. But would like to more opinions.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to