[
https://issues.apache.org/jira/browse/CALCITE-6525?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde reassigned CALCITE-6525:
------------------------------------
Assignee: Julian Hyde
> Query with one-to-many join of measure to regular table
> -------------------------------------------------------
>
> Key: CALCITE-6525
> URL: https://issues.apache.org/jira/browse/CALCITE-6525
> Project: Calcite
> Issue Type: Improvement
> Reporter: Julian Hyde
> Assignee: Julian Hyde
> Priority: Major
>
> The following query has one-to-many join of a table with a measure
> ({{deptm}}) to regular table ({{emp}}):
> {code}
> with deptm as
> (select deptno, dname, avg(char_length(dname)) as measure m
> from dept)
> select aggregate(m) as m
> from deptm join emp using (deptno);
> {code}
> The result should preserve the grain of the measure, that is, include each
> department once in the {{AVG}}, not give more weight to departments with more
> employees. To that end, the expanded query should include something like
> {{avg(char_length(d.dname)) within distinct (d.deptno)}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)