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

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.4.0
    • Component/s: SQL
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: