Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-23899 Built-in SQL Function Improvement
  3. SPARK-23909

High-order function: filter(array<T>, function<T, boolean>) → array<T>

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.4.0
    • SQL
    • None

    Description

      Ref: https://prestodb.io/docs/current/functions/array.html

      Constructs an array from those elements of array for which function returns true:

      SELECT filter(ARRAY [], x -> true); -- []
      SELECT filter(ARRAY [5, -6, NULL, 7], x -> x > 0); -- [5, 7]
      SELECT filter(ARRAY [5, NULL, 7, NULL], x -> x IS NOT NULL); -- [5, 7]
      

      Attachments

        Activity

          People

            ueshin Takuya Ueshin
            smilegator Xiao Li
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: