Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-27425

Add count_if functions

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.1
    • Fix Version/s: 3.0.0
    • Component/s: SQL
    • Labels:
      None

      Description

      Add aggregation function which returns the number of records satisfying a given condition.

      For Presto, count_if function is supported, we can write concisely.

      However, Spark does not support yet, we need to write like COUNT(CASE WHEN some_condition THEN 1 END) or SUM(CASE WHEN some_condition THEN 1 END), which looks painful.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cryeo Chaerim Yeo
                Reporter:
                cryeo Chaerim Yeo
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: