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

Support If() as a built-in function of TableAPI

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Resolved
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: Table API & SQL
    • Labels:
      None

      Description

      Most sql system support if() as a built-in udf. However, we didn't register the if() in the function category. A great many of our users use syntax 'if(a, b, c)'. Also most sql systems support 'if(a, b, c)' syntax.

      Mysql: https://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html#function_if

      Hive: https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-ConditionalFunctions

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user clarkyzl opened a pull request:

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

          FLINK-6068 [table] Support If() in built in function of TableAPI

          Type: Improvement
          Priority: Major
          Components: table, udf
          Problem Definition: We didn't register the if() in the function category. We didn't support syntax 'if(a, b, c)'.

          Design:
          1. Register If in function category.
          1. Add some tests.

          Impact Analysis: A newly registered function, without more impacts on others.
          Test:
          `mvn clean verify` is done

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

          $ git pull https://github.com/clarkyzl/flink flink-6068

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

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


          commit fcc82d7ff106af7315d8e0f57993212e8221e9e9
          Author: Zhuoluo Yang <zhuoluo.yzl@alibaba-inc.com>
          Date: 2017-03-16T08:07:33Z

          FLINK-6068 [table] Support If() in built in function of TableAPI


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user clarkyzl opened a pull request: https://github.com/apache/flink/pull/3553 FLINK-6068 [table] Support If() in built in function of TableAPI Type: Improvement Priority: Major Components: table, udf Problem Definition: We didn't register the if() in the function category. We didn't support syntax 'if(a, b, c)'. Design: 1. Register If in function category. 1. Add some tests. Impact Analysis: A newly registered function, without more impacts on others. Test: `mvn clean verify` is done You can merge this pull request into a Git repository by running: $ git pull https://github.com/clarkyzl/flink flink-6068 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3553.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 #3553 commit fcc82d7ff106af7315d8e0f57993212e8221e9e9 Author: Zhuoluo Yang <zhuoluo.yzl@alibaba-inc.com> Date: 2017-03-16T08:07:33Z FLINK-6068 [table] Support If() in built in function of TableAPI
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user twalthr commented on the issue:

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

          I think we've already had the discussion about naming the if. We can add it, but we should also update the documentation about the alternative syntax for Java.

          Show
          githubbot ASF GitHub Bot added a comment - Github user twalthr commented on the issue: https://github.com/apache/flink/pull/3553 I think we've already had the discussion about naming the if. We can add it, but we should also update the documentation about the alternative syntax for Java.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user KurtYoung commented on the issue:

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

          Since `IF` is not sql standard, i think we could let java user just use `case when`

          Show
          githubbot ASF GitHub Bot added a comment - Github user KurtYoung commented on the issue: https://github.com/apache/flink/pull/3553 Since `IF` is not sql standard, i think we could let java user just use `case when`
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user clarkyzl closed the pull request at:

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

          Show
          githubbot ASF GitHub Bot added a comment - Github user clarkyzl closed the pull request at: https://github.com/apache/flink/pull/3553
          Hide
          clarkyzl Zhuoluo Yang added a comment -

          Fixed via da10a9b5f4fb95185486ff918df4ef5b2b444392

          Show
          clarkyzl Zhuoluo Yang added a comment - Fixed via da10a9b5f4fb95185486ff918df4ef5b2b444392

            People

            • Assignee:
              clarkyzl Zhuoluo Yang
              Reporter:
              clarkyzl Zhuoluo Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development