agentm / project-m36

Project: M36 Relational Algebra Engine
The Unlicense
876 stars 47 forks source link

enable references to subrelation attributes for aggregations #370

Open agentm opened 3 weeks ago

agentm commented 3 weeks ago

Project:M36 currently supports aggregate functions by applying fold functions to sub-relations, but the functions expect a single-attributed relation. However, if we force the user to project to a single attribute, then duplicate values are only counted once, skewing the aggregation. TutorialD should allow referencing attributes in a sub-relation:

s group ({city, s#, sname, status} as s):{mean:=mean(@s.status)}

The new syntax allows an relation-valued attribute to have a "sub-attribute".