Skip to content

fix(asap-planner) : emit MinMax with GROUP BY grouping for spatial SQL MIN/MAX #386

@akanksha-akkihal

Description

@akanksha-akkihal

Problem

For 1-second spatial ClickHouse queries using MIN / MAX with GROUP BY
(e.g., MAX(pkt_len) GROUP BY dstip), the asap-planner was generating the wrong configuration.

It was using MultipleMinMax, with:

  • grouping: empty
  • aggregated: GROUP BY columns (like dstip)
  • rollup: all other columns (srcip, proto, etc.)

This setup treats all data as one big group with sub-groups inside it.

However, the query engine expects a simpler setup using MinMax:

  • grouping: GROUP BY columns (dstip)
  • aggregated: empty
  • rollup: empty

This means: compute one min/max per dstip every second.

Because of this mismatch:

  • Queries failed or returned empty results (e.g., “no precomputed outputs”)
  • Even when data ingestion was working correctly
  • Since the planner config didn’t match what the engine expects

Note:
This issue only affected 1-second spatial queries.
Other queries (like multi-second or temporal queries) were already correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions