[ 
https://issues.apache.org/jira/browse/FLINK-7024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16067675#comment-16067675
 ] 

ASF GitHub Bot commented on FLINK-7024:
---------------------------------------

Github user wuchong commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4210#discussion_r124705183
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/logical/operators.scala
 ---
    @@ -654,17 +654,23 @@ case class WindowAggregate(
         }
     
         // validate property
    -    if (propertyExpressions.nonEmpty) {
    -      resolvedWindowAggregate.window match {
    -        case TumblingGroupWindow(_, _, size) if isRowCountLiteral(size) =>
    -          failValidation("Window start and Window end cannot be selected " 
+
    -                           "for a row-count Tumbling window.")
    +    propertyExpressions.foreach {
    +      _.child match {
    +        case WindowEnd(_) | WindowStart(_) =>
    +          resolvedWindowAggregate.window match {
    +            case TumblingGroupWindow(_, _, size) if 
isRowCountLiteral(size) =>
    +              failValidation(
    +                "Window start and Window end cannot be selected " +
    +                  "for a row-count Tumbling window.")
     
    -        case SlidingGroupWindow(_, _, size, _) if isRowCountLiteral(size) 
=>
    -          failValidation("Window start and Window end cannot be selected " 
+
    -                           "for a row-count Sliding window.")
    +            case SlidingGroupWindow(_, _, size, _) if 
isRowCountLiteral(size) =>
    +              failValidation(
    +                "Window start and Window end cannot be selected " +
    +                  "for a row-count Sliding window.")
     
    -        case _ => // ok
    +            case _ => // ok
    --- End diff --
    
    Can you add a comment here that the `RowtimeAttribute` and 
`ProctimeAttribute` should pass ?


> Add supported for selecting window proctime/rowtime  on row-based 
> Tumble/Slide window 
> --------------------------------------------------------------------------------------
>
>                 Key: FLINK-7024
>                 URL: https://issues.apache.org/jira/browse/FLINK-7024
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API & SQL
>    Affects Versions: 1.4.0
>            Reporter: sunjincheng
>            Assignee: sunjincheng
>
> We get validate exception,when selecting window.proctime/rowtime on row-based 
> group window.
> {code}
>  table
>       .window(Tumble over 2.rows on 'proctime as 'w)
>       .groupBy('w, 'string)
>       .select('string, countFun('string) as 'cnt, 'w.rowtime as 'proctime)
>       .window(Over partitionBy 'string orderBy 'proctime preceding 
> UNBOUNDED_RANGE following CURRENT_RANGE as 'w2)
>       .select('string, 'cnt.sum over 'w2 as 'cnt)
> {code}
> Exception:
> {code}
> org.apache.flink.table.api.ValidationException: Window start and Window end 
> cannot be selected for a row-count Tumbling window.
>       at 
> org.apache.flink.table.plan.logical.LogicalNode.failValidation(LogicalNode.scala:143)
>       at 
> org.apache.flink.table.plan.logical.WindowAggregate.validate(operators.scala:660)
> {code}
> We should add window.proctime/rowtime check in `validate ` method.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to