Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6941

Selecting window start / end on over window causes field not resolve exception

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.3.1, 1.4.0
    • Component/s: Table API & SQL
    • Labels:
      None

      Description

      Selecting window start / end on over window causes field not resolve exception.
      The following program:

      table
            .window(
              Over partitionBy 'c orderBy 'proctime preceding UNBOUNDED_ROW as 'w)
            .select('c, countFun('b) over 'w, 'w.start, 'w.end)
      

      causes

      org.apache.flink.table.api.ValidationException: Cannot resolve [w] given input [a, b, c, proctime].
      
      	at org.apache.flink.table.plan.logical.LogicalNode.failValidation(LogicalNode.scala:143)
      	at org.apache.flink.table.plan.logical.LogicalNode$$anonfun$validate$1.applyOrElse(LogicalNode.scala:86)
      	at org.apache.flink.table.plan.logical.LogicalNode$$anonfun$validate$1.applyOrElse(LogicalNode.scala:83)
      	at org.apache.flink.table.plan.TreeNode.postOrderTransform(TreeNode.scala:72)
      	at org.apache.flink.table.plan.TreeNode$$anonfun$1.apply(TreeNode.scala:46)
      	at scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
      	at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
      

      We should validate that the start and end window properties are not accessed on over windows.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user sunjincheng121 opened a pull request:

          https://github.com/apache/flink/pull/4137

          FLINK-6941[table]Add validate that the start and end window propert…

          Add validate that the start and end window properties are not accessed on over windows.

          • [x] General
          • The pull request references the related JIRA issue ("[FLINK-XXX] Jira title text")
          • The pull request addresses only one issue
          • Each commit in the PR has a meaningful commit message (including the JIRA id)
          • [ ] Documentation
          • Documentation has been added for new functionality
          • Old documentation affected by the pull request has been updated
          • JavaDoc for public methods has been added
          • [x] Tests & Build
          • Functionality added by the pull request is covered by tests
          • `mvn clean verify` has been executed successfully locally or a Travis build has passed

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/sunjincheng121/flink FLINK-6941-PR

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/flink/pull/4137.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #4137


          commit 2d5405c684e21cf0a89f390ae9ea9ba762fc2767
          Author: sunjincheng121 <sunjincheng121@gmail.com>
          Date: 2017-06-19T00:06:15Z

          FLINK-6941[table]Add validate that the start and end window properties are not accessed on over windows


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user sunjincheng121 opened a pull request: https://github.com/apache/flink/pull/4137 FLINK-6941 [table] Add validate that the start and end window propert… Add validate that the start and end window properties are not accessed on over windows. [x] General The pull request references the related JIRA issue (" [FLINK-XXX] Jira title text") The pull request addresses only one issue Each commit in the PR has a meaningful commit message (including the JIRA id) [ ] Documentation Documentation has been added for new functionality Old documentation affected by the pull request has been updated JavaDoc for public methods has been added [x] Tests & Build Functionality added by the pull request is covered by tests `mvn clean verify` has been executed successfully locally or a Travis build has passed You can merge this pull request into a Git repository by running: $ git pull https://github.com/sunjincheng121/flink FLINK-6941 -PR Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/4137.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4137 commit 2d5405c684e21cf0a89f390ae9ea9ba762fc2767 Author: sunjincheng121 <sunjincheng121@gmail.com> Date: 2017-06-19T00:06:15Z FLINK-6941 [table] Add validate that the start and end window properties are not accessed on over windows
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/4137#discussion_r122681031

          — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala —
          @@ -1004,6 +1004,11 @@ class OverWindowedTable(
          table.logicalPlan,
          table.tableEnv)

          + if(fields.exists(_.isInstanceOf[WindowProperty])){
          + throw ValidationException(
          + "Window start and Window end can not be used on over windowed tables.")
          — End diff –

          What do you think about `"Window start and end properties are not available for Over windows."`?

          Show
          githubbot ASF GitHub Bot added a comment - Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/4137#discussion_r122681031 — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala — @@ -1004,6 +1004,11 @@ class OverWindowedTable( table.logicalPlan, table.tableEnv) + if(fields.exists(_.isInstanceOf [WindowProperty] )){ + throw ValidationException( + "Window start and Window end can not be used on over windowed tables.") — End diff – What do you think about `"Window start and end properties are not available for Over windows."`?
          Hide
          githubbot ASF GitHub Bot added a comment -

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

          https://github.com/apache/flink/pull/4137#discussion_r122682340

          — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala —
          @@ -1004,6 +1004,11 @@ class OverWindowedTable(
          table.logicalPlan,
          table.tableEnv)

          + if(fields.exists(_.isInstanceOf[WindowProperty])){
          + throw ValidationException(
          + "Window start and Window end can not be used on over windowed tables.")
          — End diff –

          Also make sense to me.

          Show
          githubbot ASF GitHub Bot added a comment - Github user sunjincheng121 commented on a diff in the pull request: https://github.com/apache/flink/pull/4137#discussion_r122682340 — Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala — @@ -1004,6 +1004,11 @@ class OverWindowedTable( table.logicalPlan, table.tableEnv) + if(fields.exists(_.isInstanceOf [WindowProperty] )){ + throw ValidationException( + "Window start and Window end can not be used on over windowed tables.") — End diff – Also make sense to me.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user sunjincheng121 commented on the issue:

          https://github.com/apache/flink/pull/4137

          Hi @fhueske thanks for your reviewing. I have updated the PR according your suggestion.

          Best,
          SunJincheng

          Show
          githubbot ASF GitHub Bot added a comment - Github user sunjincheng121 commented on the issue: https://github.com/apache/flink/pull/4137 Hi @fhueske thanks for your reviewing. I have updated the PR according your suggestion. Best, SunJincheng
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user fhueske commented on the issue:

          https://github.com/apache/flink/pull/4137

          thanks!
          +1 to merge

          Show
          githubbot ASF GitHub Bot added a comment - Github user fhueske commented on the issue: https://github.com/apache/flink/pull/4137 thanks! +1 to merge
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user fhueske commented on the issue:

          https://github.com/apache/flink/pull/4137

          will merge this

          Show
          githubbot ASF GitHub Bot added a comment - Github user fhueske commented on the issue: https://github.com/apache/flink/pull/4137 will merge this
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/flink/pull/4137

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/4137
          Hide
          fhueske Fabian Hueske added a comment -

          Fixed for 1.3.1 with b6d14b9147c8966810a184322920dac7e8ec0ee0
          Fixed for 1.4.0 with 6cf6cb8ddbedb5c5e8dcfdbf498cebef305be488

          Show
          fhueske Fabian Hueske added a comment - Fixed for 1.3.1 with b6d14b9147c8966810a184322920dac7e8ec0ee0 Fixed for 1.4.0 with 6cf6cb8ddbedb5c5e8dcfdbf498cebef305be488

            People

            • Assignee:
              sunjincheng121 sunjincheng
              Reporter:
              sunjincheng121 sunjincheng
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development