Details

    • Type: Sub-task
    • Status: Resolved
    • 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

      When we run the TableAPI as follows:

      val windowedTable = table
            .window(Over partitionBy 'c orderBy 'proctime preceding UNBOUNDED_ROW as 'w)
            .select('c, "countFun(b)" over 'w as 'mycount, weightAvgFun('a, 'b) over 'w as 'wAvg)
      

      We get the error:

      org.apache.flink.table.api.TableException: The over method can only using with aggregation expression.
      
      	at org.apache.flink.table.api.scala.ImplicitExpressionOperations$class.over(expressionDsl.scala:469)
      	at org.apache.flink.table.api.scala.ImplicitExpressionConversions$LiteralStringExpression.over(expressionDsl.scala:756)
      

      The reason is, the `over` method of `expressionDsl` not parse the String case.
      I think we should fix this before 1.3 release.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user sunjincheng121 opened a pull request:

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

          FLINK-6737[table]Add over method supported string expression as inp…

          In this PR only add over method supported string expression as input parameter.

          • [x] General
          • The pull request references the related JIRA issue ("FLINK-6737[table]Add over method supported string expression as input parameter")
          • 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-6737-PR

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

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


          commit 5acb389de1597e43855d0c6f2b7369ef7f3d80cf
          Author: sunjincheng121 <sunjincheng121@gmail.com>
          Date: 2017-05-27T06:03:06Z

          FLINK-6737[table]Add over method supported string expression as input parameter


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user sunjincheng121 opened a pull request: https://github.com/apache/flink/pull/4000 FLINK-6737 [table] Add over method supported string expression as inp… In this PR only add over method supported string expression as input parameter. [x] General The pull request references the related JIRA issue (" FLINK-6737 [table] Add over method supported string expression as input parameter") 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-6737 -PR Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/4000.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 #4000 commit 5acb389de1597e43855d0c6f2b7369ef7f3d80cf Author: sunjincheng121 <sunjincheng121@gmail.com> Date: 2017-05-27T06:03:06Z FLINK-6737 [table] Add over method supported string expression as input parameter
          Hide
          fhueske Fabian Hueske added a comment -

          I'm not sure if this should be supported. Either the whole select expression should be a String (as when using the Table API in Java) or we use Scala Expressions.
          If we do this, we could also parse any other String literal (e.g., in a condition like t.where('name === "Smith"), t might have an attribute called Smith) if it corresponds to an Expression.

          Is there a case that is not supported by a Scala expression but only by a String expression?

          Show
          fhueske Fabian Hueske added a comment - I'm not sure if this should be supported. Either the whole select expression should be a String (as when using the Table API in Java) or we use Scala Expressions. If we do this, we could also parse any other String literal (e.g., in a condition like t.where('name === "Smith") , t might have an attribute called Smith ) if it corresponds to an Expression. Is there a case that is not supported by a Scala expression but only by a String expression?
          Hide
          sunjincheng121 sunjincheng added a comment -

          Hi Fabian HueskeI think in this JIRA. only improve `over` method, not whole `select` clause. I have not met the case that is not supported by a Scala expression but only by a String expression.
          I think this is not a release blocker. If you do not want add this change, I'am okay.

          Best,
          SunJincheng

          Show
          sunjincheng121 sunjincheng added a comment - Hi Fabian Hueske I think in this JIRA. only improve `over` method, not whole `select` clause. I have not met the case that is not supported by a Scala expression but only by a String expression. I think this is not a release blocker. If you do not want add this change, I'am okay. Best, SunJincheng
          Hide
          twalthr Timo Walther added a comment -

          I'm also against this change. We should keep Java and Scala API strictly separated. A string in Scala API should stay a String and not a String-Expression.

          Show
          twalthr Timo Walther added a comment - I'm also against this change. We should keep Java and Scala API strictly separated. A string in Scala API should stay a String and not a String-Expression.
          Hide
          sunjincheng121 sunjincheng added a comment -

          Timo WaltherFabian Hueske Agree with you. I have updated the PR. And this PR only `Fix string reference variable error.` Please look at the PR.

          Thanks,
          SunJincheng

          Show
          sunjincheng121 sunjincheng added a comment - Timo Walther Fabian Hueske Agree with you. I have updated the PR. And this PR only `Fix string reference variable error.` Please look at the PR. Thanks, SunJincheng
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

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

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/4000
          Hide
          twalthr Timo Walther added a comment -

          Fixed in 1.4.0: 391d305848a8b19fa1df34aa0b247491c862ac7d
          Fixed in 1.3.0: 2ea9c5f563821aa2f394127dbd34a7c3b1a2ccf1

          Show
          twalthr Timo Walther added a comment - Fixed in 1.4.0: 391d305848a8b19fa1df34aa0b247491c862ac7d Fixed in 1.3.0: 2ea9c5f563821aa2f394127dbd34a7c3b1a2ccf1

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development