Github user hsyuan commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1189#discussion_r108025017
  
    --- Diff: src/backend/executor/nodeAgg.c ---
    @@ -1950,6 +1950,21 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
         * initialize child nodes
         */
        outerPlan = outerPlan(node);
    +   if (outerPlan->type == T_ExternalScan) {
    +           /*
    +            * Hack to indicate to PXF when there is an external scan
    +            */
    +           if (aggstate->aggs && list_length(aggstate->aggs) == 1) {
    +                   foreach(l, aggstate->aggs) {
    +                           AggrefExprState *aggrefstate = (AggrefExprState 
*) lfirst(l);
    +                           Aggref     *aggref = (Aggref *) 
aggrefstate->xprstate.expr;
    +                           //Only dealing with one agg
    +                           if (aggref->aggfnoid == 2147 || 
aggref->aggfnoid == 2803) {
    --- End diff --
    
    Would be better use `COUNT_ANY_OID` and `COUNT_STAR_OID`...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to