Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.0, 1.4.0
    • Component/s: Table API & SQL
    • Labels:
      None

      Description

      I find 2 bugs as follows:

      1. GroupWindowStringExpressionTest testcase bug:

      Assert.assertEquals("Logical Plans do not match", resJava.logicalPlan, resJava.logicalPlan) -> verifyTableEquals(resJava, resScala)

      2. Window properties can not select in JAVA API:
      Java Code:

       // String / Java API
          val resJava = t
            .window(JSlide.over("4.hours").every("2.hours").on("rowtime") as 'w)
            .groupBy("w, string")
            .select(
              "string, " +
              "myCountFun(string), " +
              "int.sum, " +
              "weightAvgFun(long, int), " +
              "weightAvgFun(int, int) * 2, " +
              "start(w)," +
              "end(w)")
      

      Exception Info:

      org.apache.flink.table.api.ValidationException: Cannot resolve [w] given input [int, long, string, rowtime].
      
      	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.logical.LogicalNode.org$apache$flink$table$plan$logical$LogicalNode$$expressionPostOrderTransform$1(LogicalNode.scala:119)
      	at org.apache.flink.table.plan.logical.LogicalNode$$anonfun$7$$anonfun$apply$1.apply(LogicalNode.scala:132)
      	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
      	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
       

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user sunjincheng121 opened a pull request:

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

          FLINK-6618[table] Fix GroupWindowStringExpressionTest test case bug

          In this PR. I had fix the `GroupWindowStringExpressionTest` test case bug

          • [x] General
          • The pull request references the related JIRA issue ("FLINK-6618[table] Fix GroupWindowStringExpressionTest testcase bug")
          • 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
          • [ ] 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-6618-PR

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

          https://github.com/apache/flink/pull/3936.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 #3936


          commit f331798000bbf8ce6316862545c761583e8b9eef
          Author: sunjincheng121 <sunjincheng121@gmail.com>
          Date: 2017-05-18T05:02:24Z

          FLINK-6618[table] Fix GroupWindowStringExpressionTest testcase bug


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user sunjincheng121 opened a pull request: https://github.com/apache/flink/pull/3936 FLINK-6618 [table] Fix GroupWindowStringExpressionTest test case bug In this PR. I had fix the `GroupWindowStringExpressionTest` test case bug [x] General The pull request references the related JIRA issue (" FLINK-6618 [table] Fix GroupWindowStringExpressionTest testcase bug") 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 [ ] 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-6618 -PR Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3936.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 #3936 commit f331798000bbf8ce6316862545c761583e8b9eef Author: sunjincheng121 <sunjincheng121@gmail.com> Date: 2017-05-18T05:02:24Z FLINK-6618 [table] Fix GroupWindowStringExpressionTest testcase bug
          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/3936#discussion_r117196683

          — Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/table/stringexpr/GroupWindowStringExpressionTest.scala —
          @@ -47,19 +47,23 @@ class GroupWindowStringExpressionTest extends TableTestBase {
          myCountFun('string),
          'int.sum,
          weightAvgFun('long, 'int),

          • weightAvgFun('int, 'int) * 2)
            + weightAvgFun('int, 'int) * 2,
            + 'w.start,
            + 'w.end)

          // String / Java API
          val resJava = t

          • .window(JSlide.over("4.hours").every("2.hours").on("rowtime").as("w"))
            + .window(JSlide.over("4.hours").every("2.hours").on("rowtime") as 'w)
              • End diff –

          Why are you changing `"w"` to a Scala expression `'w`? The test should check that Strings are correctly translated to expressions .

          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/3936#discussion_r117196683 — Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/table/stringexpr/GroupWindowStringExpressionTest.scala — @@ -47,19 +47,23 @@ class GroupWindowStringExpressionTest extends TableTestBase { myCountFun('string), 'int.sum, weightAvgFun('long, 'int), weightAvgFun('int, 'int) * 2) + weightAvgFun('int, 'int) * 2, + 'w.start, + 'w.end) // String / Java API val resJava = t .window(JSlide.over("4.hours").every("2.hours").on("rowtime").as("w")) + .window(JSlide.over("4.hours").every("2.hours").on("rowtime") as 'w) End diff – Why are you changing `"w"` to a Scala expression `'w`? The test should check that Strings are correctly translated to expressions .
          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/3936#discussion_r117202137

          — Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/table/stringexpr/GroupWindowStringExpressionTest.scala —
          @@ -47,19 +47,23 @@ class GroupWindowStringExpressionTest extends TableTestBase {
          myCountFun('string),
          'int.sum,
          weightAvgFun('long, 'int),

          • weightAvgFun('int, 'int) * 2)
            + weightAvgFun('int, 'int) * 2,
            + 'w.start,
            + 'w.end)

          // String / Java API
          val resJava = t

          • .window(JSlide.over("4.hours").every("2.hours").on("rowtime").as("w"))
            + .window(JSlide.over("4.hours").every("2.hours").on("rowtime") as 'w)
              • End diff –

          Yes, both of them are work.But you are right. we should using "w".

          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/3936#discussion_r117202137 — Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/table/stringexpr/GroupWindowStringExpressionTest.scala — @@ -47,19 +47,23 @@ class GroupWindowStringExpressionTest extends TableTestBase { myCountFun('string), 'int.sum, weightAvgFun('long, 'int), weightAvgFun('int, 'int) * 2) + weightAvgFun('int, 'int) * 2, + 'w.start, + 'w.end) // String / Java API val resJava = t .window(JSlide.over("4.hours").every("2.hours").on("rowtime").as("w")) + .window(JSlide.over("4.hours").every("2.hours").on("rowtime") as 'w) End diff – Yes, both of them are work.But you are right. we should using "w".
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user fhueske commented on the issue:

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

          Thanks for the update. +1 to merge

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

          Github user fhueske commented on the issue:

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

          Merging

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

          Github user asfgit closed the pull request at:

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

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

          Fixed for 1.3.0 with 6583fb4c1f85d5c4f57a81ec9a6294915ea165ac
          Fixed for 1.4.0 with 41aa98a2189ea86ba9464fb0348463af822e332d

          Show
          fhueske Fabian Hueske added a comment - Fixed for 1.3.0 with 6583fb4c1f85d5c4f57a81ec9a6294915ea165ac Fixed for 1.4.0 with 41aa98a2189ea86ba9464fb0348463af822e332d

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development