Skip to content

Re-enable the two ignored CometAggregateSuite metric tests after the DataFusion 55 peak_mem_used change #5703

Open

Description

@andygrove

Describe the bug

Two tests in CometAggregateSuite are disabled on the DataFusion 55 branch with only a prose TODO and no tracking issue:

// TODO: To be addressed after DF 55 migration
ignore("grouped aggregate metrics are forwarded without fabricating global metrics") {
...
// TODO: To be addressed after DF 55 migration
ignore("range sampling does not report grouped aggregate metrics") {

They assert on spill_count, spilled_bytes, spilled_rows and peak_mem_used. peak_mem_used accounting changed in apache/datafusion#22710, which is what broke them.

Steps to reproduce

Un-ignore either test on the df55 branch.

Expected behavior

Either the assertions are adapted to DataFusion 55's accounting, or the metric is reported the way the tests expect. Either way the skips should point at this issue rather than a prose TODO, which is easy to lose once the branch merges.

Additional context

@sunchao offered to take this as a follow-up after #5262 merges. Related: the CometTPCHQuerySuite off-heap bump tracked separately.

Activity

  1. added
    testTesting related
    priority:mediumFunctional bugs, performance regressions, broken features
    area:aggregationHash aggregates, aggregate expressions
    on Sep 5, 2026
  2. andygrove commented on Sep 5, 2026

    @andygrove
    MemberAuthor

    Tracked under #5709 ([EPIC] DataFusion 55 upgrade follow-ups).

  3. ErikBPF commented on Sep 13, 2026

    @ErikBPF
    Contributor

    I reproduced the two ignored aggregate-metric tests on
    f69c4c81b9429e327ea95658530ae4ed4ed19635, with DataFusion 55.1.0, Spark
    4.1.3, and a release native library. I re-enabled only those tests and
    explicitly enabled CometConf.COMET_RESPECT_DATAFUSION_CONFIGS in each
    test's configuration.

    The sole difference between the two diagnostic runs was
    spark.comet.datafusion.execution.enable_migration_aggregate:

    Value Result
    true (default) Both tests failed at positive peak_mem_used assertions
    false Both tests passed

    The grouped test reported Expected peak aggregate memory for modes List(Final). The sampling test passed the sampling-exclusion checks and
    failed at the positive peak assertion after execution.

    Source inspection matches this result: the migrated implementation in
    DataFusion's aggregates/hash_stream.rs uses memory reservations and spill
    metrics but does not register the peak_mem_used gauge. The legacy grouped
    stream registers and updates it; Comet forwards registered metrics.

    This points to missing peak-memory instrumentation in migrated aggregation.
    It does not show missing memory accounting or prove increased memory use.
    Disabling migration was only a diagnostic control. I have left the tests
    and production defaults unchanged, since restoration of these metrics is
    already being coordinated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:aggregationHash aggregates, aggregate expressionsbugSomething isn't workingpriority:mediumFunctional bugs, performance regressions, broken featurestestTesting related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions