You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "pchintar (via GitHub)" <gi...@apache.org> on 2026/04/17 07:28:12 UTC

[I] Add native support for MODE aggregate function [datafusion-comet]

pchintar opened a new issue, #3970:
URL: https://github.com/apache/datafusion-comet/issues/3970

   ### Description
   
   Currently, the `MODE` aggregate function is not supported natively in Comet and falls back to Spark execution.
   
   `MODE` is a commonly used statistical aggregate that returns the most frequent value in a group. The lack of native support prevents queries using `MODE` from benefiting from Comet’s execution pipeline.
   
   ---
   
   ### Motivation
   
   * Enables full native execution for queries involving `MODE`
   * Avoids fallback to Spark, improving performance and consistency
   * Brings Comet closer to feature parity with Spark SQL
   
   ---
   
   ### Proposed Change
   
   Add native support for the `MODE` aggregate function with:
   
   * Full correctness across all supported data types
   * Proper handling of null and edge cases
   * Support for partial and final aggregation (mergeable state)
   * Integration with Comet’s `GroupsAccumulator` for grouped queries
   
   ---
   
   ### Expected Behavior
   
   Queries using `MODE` should:
   
   * Execute fully within Comet (no fallback)
   * Return correct results across all supported types
   * Handle edge cases such as:
   
     * all-null inputs
     * ties (consistent with Spark behavior)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Add native support for MODE aggregate function [datafusion-comet]

Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove closed issue #3970: Add native support for MODE aggregate function
URL: https://github.com/apache/datafusion-comet/issues/3970


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org