Skip to content

suggested syntax for aggregation #52

@burakemir

Description

@burakemir

The aggregation syntax - apart from being quite undocumented - needs much explanation.
Erik Meijer suggested via LinkedIn:

| I would love to be able to write something like

count_projects_with_vulnerable_log4j(Num) :-
 projects_with_vulnerable_log4j(P)
 |> { AllVulnProjects =>
 val groups = AllVulnProjects.groupBy { it.projectId }
 val Num = groups.values.sumOf { it.size }
 }

The reason for "do transformations" |> do fn:group_by(...) was to have something declarative so that it could be implemented and optimized differently. However, with a judiciously designed sublanguage, that may still be possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions