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

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

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4.0
    • 1.20.0
    • 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. how to add a scalar function.png
          159 kB
          Xingcan Cui
        1.
        Add STR_TO_DATE supported in SQL Sub-task In Progress Unassigned  
        2.
        Add STR_TO_DATE supported in TableAPI Sub-task Open Unassigned  
        3.
        Add reverse supported in TableAPI and SQL Sub-task In Progress Unassigned  
        4.
        Add REGEXP_MATCH in TableAPI and SQL Sub-task Open Unassigned  
        5.
        Add REMAINDER math function supported in Table API and SQL Sub-task Open Unassigned  
        6.
        Add Reverse function supported in Table API and SQL Sub-task Open Unassigned
        7.
        [Bitwise Functions] Add BIT_AND, BIT_OR functions supported in Table API and SQL Sub-task Open Unassigned  
        8.
        [Bitwise Functions] Add BIT_LSHIFT, BIT_RSHIFT functions supported in Table API and SQL Sub-task Open Ran Tao  
        9.
        [Bitwise Functions] Add BIT_XOR function supported in Table API and SQL Sub-task Open Ran Tao  
        10.
        Built-in functions for collections Sub-task Reopened Sergey Nuyanzin  
        11.
        Add TRANSLATE supported in SQL & Table API Sub-task Open Unassigned  
        12.
        Add SUBSTRING_INDEX supported in SQL & Table API Sub-task Open Unassigned  
        13.
        Add DATE_ADD supported in SQL & Table API Sub-task Open Unassigned  
        14.
        Add ADD_MONTHS supported in SQL and Table API Sub-task Open Unassigned  
        15.
        Add DATE_SUB supported in SQL & Table API Sub-task Open Unassigned  
        16.
        Add SHIFTRIGHT supported in SQL & Table API Sub-task Open Unassigned  
        17.
        Add NVL supported in SQL & Table API Sub-task Open Unassigned  
        18.
        Add HASH supported in SQL & Table API Sub-task Open Unassigned  
        19.
        Add ARRAY_SIZE supported in SQL & Table API Sub-task Open Jacky Lau  
        20.
        Add URL_ENCODE and URL_DECODE function Sub-task Open Unassigned  
        21.
        Add JSON_QUOTE and JSON_UNQUOTE function Sub-task Open Jeyhun Karimov  
        22.
        Support MODE aggregate function Sub-task Open Sergey Nuyanzin  

        Activity

          People

            sunjincheng121 sunjincheng
            sunjincheng121 sunjincheng
            Votes:
            0 Vote for this issue
            Watchers:
            30 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

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