[ https://issues.apache.org/jira/browse/HAWQ-442?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
zhenglin tao reassigned HAWQ-442: --------------------------------- Assignee: zhenglin tao (was: Lei Chang) > set the wrong resname of TargetEntry for group by clause > -------------------------------------------------------- > > Key: HAWQ-442 > URL: https://issues.apache.org/jira/browse/HAWQ-442 > Project: Apache HAWQ > Issue Type: Bug > Components: Core > Reporter: zhenglin tao > Assignee: zhenglin tao > > Reproduce steps: > {code} > create table sale > ( > cn int not null, > vn int not null, > pn int not null, > dt date not null, > qty int not null, > prc float not null > ) WITH (appendonly=true, orientation = parquet) distributed by (cn,vn,pn); > insert into sale values > ( 2, 40, 100, '1401-1-1', 1100, 2400); > taoz=# explain SELECT sale.qty as newalias1,sale.qty as newalias2 FROM sale > GROUP BY ROLLUP(newalias2,newalias1); > QUERY PLAN > ------------------------------------------------------------------------------------------------------------------------------------------------ > Gather Motion 8:1 (slice2; segments: 8) (cost=1.06..1.09 rows=3 width=8) > -> HashAggregate (cost=1.06..1.09 rows=1 width=8) > Group By: partial_aggregation.newalias1, > partial_aggregation.newalias1, partial_aggregation."grouping", > partial_aggregation."group_id" > -> Subquery Scan partial_aggregation (cost=1.02..1.06 rows=0 > width=20) > -> Redistribute Motion 8:8 (slice1; segments: 8) > (cost=1.02..1.06 rows=0 width=20) > Hash Key: "rollup".newalias1, "rollup".newalias1 > -> GroupAggregate (cost=1.02..1.06 rows=0 width=20) > Group By: "rollup"."grouping", "rollup"."group_id" > -> Subquery Scan "rollup" (cost=1.02..1.06 > rows=0 width=20) > -> GroupAggregate (cost=1.02..1.06 rows=0 > width=20) > Group By: "rollup".newalias1, > "rollup"."grouping", "rollup"."group_id" > -> Subquery Scan "rollup" > (cost=1.02..1.05 rows=1 width=20) > -> GroupAggregate > (cost=1.02..1.04 rows=1 width=20) > Group By: sale.qty, > sale.qty > -> Sort (cost=1.02..1.02 > rows=1 width=4) > Sort Key: sale.qty, > sale.qty > -> Parquet table > Scan on sale (cost=0.00..1.01 rows=1 width=4) > Settings: optimizer=off > Optimizer status: legacy query optimizer > (19 rows) > {code} > Wrongly used the name newalias1 and newalias2 -- This message was sent by Atlassian JIRA (v6.3.4#6332)