-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HAWQ-1409. Send AGG-TYPE header to PXF #1189
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,20 @@ void build_http_header(PxfInputData *input) | |
else | ||
churl_headers_append(headers, "X-GP-HAS-FILTER", "0"); | ||
|
||
/* Aggregate information */ | ||
if (input->agg_type) { | ||
char agg_groups_str[sizeof(int32)]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this var used? |
||
|
||
switch(input->agg_type) { | ||
case EXEC_FLAG_EXTERNAL_AGG_COUNT: | ||
churl_headers_append(headers, "X-GP-AGG-TYPE", "count"); | ||
break; | ||
default: | ||
churl_headers_append(headers, "X-GP-AGG-TYPE", "unknown"); | ||
break; | ||
} | ||
} | ||
|
||
add_delegation_token_headers(headers, input); | ||
add_remote_credentials(headers); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1950,6 +1950,21 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) | |
* initialize child nodes | ||
*/ | ||
outerPlan = outerPlan(node); | ||
if (outerPlan->type == T_ExternalScan) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better use |
||
/* | ||
* Hack to indicate to PXF when there is an external scan | ||
*/ | ||
if (aggstate->aggs && list_length(aggstate->aggs) == 1) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh ok, I thought |
||
foreach(l, aggstate->aggs) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if the size of |
||
AggrefExprState *aggrefstate = (AggrefExprState *) lfirst(l); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just by changing |
||
Aggref *aggref = (Aggref *) aggrefstate->xprstate.expr; | ||
//Only dealing with one agg | ||
if (aggref->aggfnoid == 2147 || aggref->aggfnoid == 2803) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be better use |
||
eflags |= EXEC_FLAG_EXTERNAL_AGG_COUNT; | ||
} | ||
} | ||
} | ||
} | ||
outerPlanState(aggstate) = ExecInitNode(outerPlan, estate, eflags); | ||
|
||
/* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend to use
IsA(rootPlan, Agg)