Skip to main content

FUNCTIONS_LIST

Constant FUNCTIONS_LIST 

Source
pub const FUNCTIONS_LIST: &str = "%YAML 1.2\n---\nurn: extension:io.substrait:functions_list\nscalar_functions:\n  - name: \"transform\"\n    description: >-\n      Transforms each element of a list using the provided function.\n      Also known as \"map\" in functional programming.\n\n      Returns a new list where each element is the result of applying\n      the transformer to the corresponding element in the input list.\n\n      The transformer receives one parameter (the current element) and must return\n      the transformed value.\n\n      If the input list is null, the result is null.\n    impls:\n      - args:\n          - name: input\n            value: list<any1>\n          - name: transformer\n            value: func<any1 -> any2>\n        nullability: MIRROR\n        return: list<any2>\n\n  - name: \"filter\"\n    description: >-\n      Filters a list of elements based on a predicate function.\n\n      Returns a new list containing only elements for which the predicate\n      function returns true.\n\n      The predicate receives one parameter (the current element) and must return a\n      boolean.\n\n      Elements for which the predicate returns true are included in the\n      result. Elements for which the predicate returns false or null are excluded.\n\n      If the input list is null, the result is null.\n    impls:\n      - args:\n          - name: input\n            value: list<any1>\n          - name: predicate\n            value: func<any1 -> boolean?>\n        nullability: MIRROR\n        return: list<any1>\n\n  - name: \"cardinality\"\n    description: >-\n      Returns the number of elements in the list.\n\n      Null elements are counted. If the input list is null, the result is null.\n    impls:\n      - args:\n          - name: input\n            value: list<any1>\n        nullability: MIRROR\n        return: i64\n\n  # TODO: Add comparator overload for custom sorting (see #972)\n  - name: \"sort\"\n    description: >-\n      Sorts the elements of a list. Elements must be orderable.\n\n      If the input list is null, the result is null.\n    impls:\n      - args:\n          - name: input\n            value: list<any1>\n        options:\n          direction:\n            description: >-\n              Sort direction and null placement, matching SortField.SortDirection\n              in the Sort relation.\n            values: [ASC_NULLS_FIRST, ASC_NULLS_LAST, DESC_NULLS_FIRST, DESC_NULLS_LAST]\n        nullability: MIRROR\n        return: list<any1>\n\n  - name: \"any_match\"\n    description: >-\n      Returns true if the predicate returns true for any element of the list.\n\n      More precisely\n      * If the list is null, or the predicate is null, returns null.\n      * If the list is empty, returns false as no element matches the predicate.\n\n      Otherwise\n      * Returns true if the predicate returns true for at least one element.\n      * Returns false if the predicate returns false for all elements.\n      * Returns null if the predicate does not return true for any element,\n      and returns null for at least one element.\n\n      This behaviour is equivalent to applying the predicate to every element\n      of the list, and then OR-ing all of the results together. This is\n      consistent with the Kleene logic defined in\n      extension:io.substrait:functions_boolean::or\n    impls:\n      - args:\n          - name: input\n            value: list<any1>\n          - name: predicate\n            value: func<any1 -> boolean?>\n        nullability: DECLARED_OUTPUT\n        return: boolean?\n\n  - name: \"all_match\"\n    description: >-\n      Returns true if the predicate returns true for all elements of the list.\n\n      More precisely\n      * If the list is null, or the predicate is null, returns null.\n      * If the list is empty, returns true as no element fails the predicate.\n\n      Otherwise\n      * Returns false if the predicate returns false for at least one element.\n      * Returns true if the predicate returns true for all elements.\n      * Returns null if the predicate does not return false for any element,\n      and returns null for at least one element.\n\n      This behaviour is equivalent to applying the predicate to every element\n      of the list, and then AND-ing all of the results together. This is\n      consistent with the Kleene logic defined in\n      extension:io.substrait:functions_boolean::and\n    impls:\n      - args:\n          - name: input\n            value: list<any1>\n          - name: predicate\n            value: func<any1 -> boolean?>\n        nullability: DECLARED_OUTPUT\n        return: boolean?\n";
Expand description

Included source of the functions_list extension YAML file.