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

Add a set of built-in functions to Table API & SQL

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4.0
    • None
    • Table SQL / API
    • None

    Description

      Umbrella issue for adding functions such as mathematical-function LOG, date-functions DATEADD, string-functions LPAD, etc.

      How to contribute a built-in function
      Thank you very much for contributing a built-in function. In order to make sure your contributions are in a good direction, it is recommended to read the following instructions.

      1. Investigate the behavior of the function that you are going to contribute in major DBMSs. This is very important since we have to understand the exact semantics and type inference of the function.
      2. It is recommended to add function for both SQL and Table API (Java, Scala, Python).
      3. For every function, add corresponding docs which should include a SQL, a Java/Scala/Python version in ./docs/dev/table/functions/systemFunctions.md. Make sure your description of the function is accurate. Please do not simply copy documentation from other projects, especially if the projects are not Apache licensed.
      4. Take overflow, handling of NULL, other data types and exceptions into consideration.

      There are different generations of function stacks in the Flink code base. The newest generation has been added in FLINK-20522 and is the recommended way of implementing a function similar to a regular user-defined function.

      Adding a built-in function requires changes in only 2 classes: BuiltInFunctionDefinitions for the definition and the class that contains the actual runtime logic.

      Tests should be added in org.apache.flink.table.planner.functions.

      See the reference implementation of the IFNULL function here:

      https://github.com/apache/flink/commit/df46f8948279d1ed89d7113919b4c4f720cf4199

      Attachments

        1.
        Add TIMESTAMPADD supported in SQL Sub-task Resolved sunjincheng   Actions
        2.
        Add TIMESTAMPADD supported in TableAPI Sub-task Resolved sunjincheng   Actions
        3.
        Add TIMESTAMPDIFF supported in SQL Sub-task Resolved sunjincheng   Actions
        4.
        Add TIMESTAMPDIFF supported in TableAPI Sub-task Resolved Unassigned   Actions
        5.
        Add LOG(X) supported in SQL Sub-task Resolved sunjincheng   Actions
        6.
        ADD LOG(X) supported in TableAPI Sub-task Closed Jiayi Liao   Actions
        7.
        Add L/RPAD supported in SQL Sub-task Resolved sunjincheng   Actions
        8.
        Add L/RPAD supported in TableAPI Sub-task Resolved sunjincheng   Actions
        9.
        Add BIN supported in SQL & Table API Sub-task Resolved sunjincheng   Actions
        10.
        Add BIN supported in TableAPI Sub-task Resolved sunjincheng   Actions
        11.
        Add STR_TO_DATE supported in SQL Sub-task In Progress Unassigned   Actions
        12.
        Add STR_TO_DATE supported in TableAPI Sub-task Open Unassigned   Actions
        13.
        Add CONCAT/CONCAT_WS supported in SQL Sub-task Closed sunjincheng   Actions
        14.
        Add CONCAT/CONCAT_WS supported in TableAPI Sub-task Closed sunjincheng   Actions
        15.
        Add support for MD5, SHA1 and SHA2 Sub-task Closed Michael Gendelman   Actions
        16.
        Add MD5/SHA1/SHA2 supported in TableAPI Sub-task Closed Alexandr Arkhipov   Actions
        17.
        Add E() supported in SQL Sub-task Closed sunjincheng   Actions
        18.
        Add E() supported in TableAPI Sub-task Resolved Timo Walther   Actions
        19.
        Add DATE_FORMAT supported in SQL Sub-task Closed Unassigned   Actions
        20.
        Add UUID supported in TableAPI/SQL Sub-task Resolved Jiayi Liao   Actions
        21.
        Fix Mod scala function bug Sub-task Resolved sunjincheng   Actions
        22.
        Add ASCII/CHR function for Table API Sub-task Open Unassigned   Actions
        23.
        Add regexp_extract supported in TableAPI and SQL Sub-task Resolved vinoyang   Actions
        24.
        Add regexp_replace supported in TableAPI and SQL Sub-task Resolved vinoyang   Actions
        25.
        Add ISNUMERIC supported in Table API/SQL Sub-task Closed vinoyang   Actions
        26.
        Add LTRIM supported in Table API and SQL Sub-task Resolved vinoyang   Actions
        27.
        Add RTRIM supported in Table API and SQL Sub-task Resolved vinoyang   Actions
        28.
        Add FROM_BASE64 function for table/sql API Sub-task Resolved vinoyang   Actions
        29.
        Add TO_BASE64 function for table/sql API Sub-task Resolved vinoyang   Actions
        30.
        Add REPEAT supported in Table API and SQL Sub-task Resolved vinoyang   Actions
        31.
        Add replace supported in TableAPI and SQL Sub-task Resolved Guibo Pan   Actions
        32.
        Add reverse supported in TableAPI and SQL Sub-task In Progress Unassigned   Actions
        33.
        Add LOG2 function for table/sql API Sub-task Resolved vinoyang   Actions
        34.
        Add REGEXP_MATCH in TableAPI and SQL Sub-task Open Unassigned   Actions
        35.
        Add Cosh math function supported in Table API and SQL Sub-task Closed vinoyang   Actions
        36.
        Add Sinh math function supported in Table API and SQL Sub-task Closed vinoyang   Actions
        37.
        Add Tanh math function supported in Table API and SQL Sub-task Closed vinoyang   Actions
        38.
        Add COTH math function supported in Table API and SQL Sub-task Closed Aleksei Izmalkin Actions
        39.
        Add CBRT math function supported in Table API and SQL Sub-task Closed Aleksei Izmalkin Actions
        40.
        Add HYPOT math function supported in Table API and SQL Sub-task Closed Aleksei Izmalkin Actions
        41.
        Add REMAINDER math function supported in Table API and SQL Sub-task Open Unassigned   Actions
        42.
        Add support for IS DISTINCT FROM in code generator Sub-task Resolved Unassigned   Actions
        43.
        Add support for IS NOT DISTINCT FROM in code generator Sub-task Resolved Unassigned   Actions
        44.
        Add Reverse function supported in Table API and SQL Sub-task Open Unassigned Actions
        45.
        [Bitwise Functions] Add BIT_AND, BIT_OR functions supported in Table API and SQL Sub-task Open Unassigned   Actions
        46.
        [Bitwise Functions] Add BIT_LSHIFT, BIT_RSHIFT functions supported in Table API and SQL Sub-task Open Unassigned   Actions
        47.
        [Bitwise Functions] Add BIT_XOR function supported in Table API and SQL Sub-task Open Unassigned   Actions
        48.
        Add contain operator for the array datatype to SQL Sub-task Closed Unassigned   Actions
        49.
        Support GREATEST and LEAST functions in SQL Sub-task Closed Leonard Xu   Actions
        50.
        Support collect to array aggregate function Sub-task Open Unassigned   Actions
        51.
        Built-in functions for collections Sub-task Open Unassigned   Actions
        52.
        Add support for CURRENT_WATERMARK to SQL Sub-task Closed Ingo Bürk   Actions

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sunjincheng121 sunjincheng
            sunjincheng121 sunjincheng

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m

                Issue deployment