Skip to content

fix(asap-planner): use MinMax with grouping for 1s spatial SQL MIN/MAX instead of MultipleMinMax#387

Closed
akanksha-akkihal wants to merge 1 commit into
mainfrom
386-fix-asap-planner-spatial-sql-minmax-configs
Closed

fix(asap-planner): use MinMax with grouping for 1s spatial SQL MIN/MAX instead of MultipleMinMax#387
akanksha-akkihal wants to merge 1 commit into
mainfrom
386-fix-asap-planner-spatial-sql-minmax-configs

Conversation

@akanksha-akkihal

Copy link
Copy Markdown
Collaborator

Code Changes Summary

asap-planner-rs/src/planner/sql.rs

Before (default behavior)

Spatial MIN / MAX queries used:

  • Aggregation: MultipleMinMax
  • grouping: []
  • aggregated: [GROUP BY columns]
  • rollup: [other metadata columns]

After

  • Introduced let mut configs to allow post-processing updates

  • Spatial MIN / MAX fix
    (applies only to QueryType::Spatial + "MIN" / "MAX"):

    • aggregation_typeMinMax
    • aggregation_sub_type"min" or "max"
    • grouping_labels → SQL GROUP BY columns (spatial_output)
    • aggregated_labels[]
    • rollup_labels[]

Unchanged

  • Temporal / spatiotemporal MIN / MAX still use MultipleMinMax

asap-planner-rs/tests/sql_integration.rs

New Test: spatial_max_pkt_len

  • Query:
    MAX(pkt_len) ... GROUP BY dstip (1-second window, netflow_table)

Runtime Impact (Generated Config)

Field Before After
Type MultipleMinMax MinMax
grouping [] [dstip] (GROUP BY cols)
aggregated [dstip] []
rollup e.g. [srcip, proto] []

Result

  • Aligns planner output with:
    • query engine expectations
    • ingest sharding (group-by as store key)

@akanksha-akkihal akanksha-akkihal changed the title fix(asap-planner) : use MinMax with grouping for 1s spatial SQL MIN/MAX instead of MultipleMinMax fix(asap-planner): use MinMax with grouping for 1s spatial SQL MIN/MAX instead of MultipleMinMax Jun 1, 2026
@akanksha-akkihal

Copy link
Copy Markdown
Collaborator Author

Not fixing. Requirements changed.

@akanksha-akkihal akanksha-akkihal deleted the 386-fix-asap-planner-spatial-sql-minmax-configs branch June 2, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant