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

Add count_if functions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.1
    • 3.0.0
    • SQL
    • 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

              cryeo Chaerim Yeo
              cryeo Chaerim Yeo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: