[
https://issues.apache.org/jira/browse/CALCITE-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde resolved CALCITE-877.
---------------------------------
Resolution: Fixed
Fixed in
http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/4000edd8.
Currently (due to parser limitations) you have to create the row in a
sub-query. You can't construct the row inside the call to COLLECT. So, write
{code}select deptno, collect(r) as empnos
from (select deptno, (empno, deptno) as r
from "scott".emp)
group by deptno{code}
> Allow ROW as argument to COLLECT
> --------------------------------
>
> Key: CALCITE-877
> URL: https://issues.apache.org/jira/browse/CALCITE-877
> Project: Calcite
> Issue Type: Bug
> Reporter: Julian Hyde
> Assignee: Julian Hyde
> Fix For: 1.5.0-incubating
>
>
> We would like to build multisets of records, for instance all of the
> employees in a department: {code}SELECT deptno, COLLECT(ROW(ename, salary))
> AS emps
> FROM emp
> GROUP BY deptno{code}
> Standard SQL only allows ROW inside a table constructor (i.e. a VALUES
> clause). A workaround is to create a user-defined type (CREATE TYPE; see
> http://www.oracle-developer.net/display.php?id=306) but it would be
> preferable to be able to create rows of anonymous type, so that the above
> SELECT statement just works.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)