[
https://issues.apache.org/jira/browse/ASTERIXDB-1727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15655798#comment-15655798
]
ASF subversion and git services commented on ASTERIXDB-1727:
------------------------------------------------------------
Commit f40081f5ad0146885e9f9a416598bf46661a2f54 in asterixdb's branch
refs/heads/master from [~wangsaeu]
[ https://git-wip-us.apache.org/repos/asf?p=asterixdb.git;h=f40081f ]
ASTERIXDB-1727: Fix an issue with multiple aggregates in one group-by
- Although the hash group-by hint is given, if multiple aggregate operators
exist in the subplan of group-by, the physical operator of the given group-by
should not be set as EXTERNAL_GROUP_BY since we don't support multiple
aggregates
in the external group by physical operator.
Change-Id: Ifb5619cc3ece00ab83962d53e004f203684df9ee
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1343
Sonar-Qube: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
Integration-Tests: Jenkins <[email protected]>
Reviewed-by: Yingyi Bu <[email protected]>
> Adding grouping hint breaks the query
> -------------------------------------
>
> Key: ASTERIXDB-1727
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-1727
> Project: Apache AsterixDB
> Issue Type: Bug
> Reporter: Pouria
> Assignee: Taewoo Kim
>
> The following query works fine with no hint. Adding a hint to use hash-based
> group-by breaks it with the following error:
> {noformat}
> Variable $$43 could not be found in any input schema. [AlgebricksException]
> {noformat}
> Here is the query:
> {noformat}
> let $customer := {{ {"cid" : 1}, {"cid" : 2} }}
> let $orders := {{
> {"oid": 100,
> "ocid" : 1,
> "priority" : 10,
> "class" : "A",
> "items" : [{"price" : 1000}, { "price" : 2000}]
> },
> {"oid": 200,
> "ocid" : 2,
> "priority" : 20,
> "class" : "A",
> "items" : [{"price" : 2000}, {"price" : 3000}]
> }
> }}
> for $c in $customer
> for $o in $orders
> where
> $c.cid = $o.ocid
> for $i in $o.items
> /*+ hash*/
> group by $o_orderid := $o.oid, $o_class := $o.class, $o_priority :=
> $o.priority
> with $i
> let $price := sum (
> for $t in $i
> return
> $t.price
> )
> order by $price desc, $o_class
> return {
> "o_orderkey": $o_orderid,
> "price": $price,
> "o_class": $o_class,
> "o_priority": $o_priority
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)