Github user hsyuan commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1189#discussion_r108025072
--- Diff: src/backend/access/external/fileam.c ---
@@ -459,12 +459,20 @@ external_stopscan(FileScanDesc scan)
* ----------------
*/
ExternalSelectDesc
-external_getnext_init(PlanState *state) {
+external_getnext_init(PlanState *state, ExternalScanState *es_state) {
ExternalSelectDesc desc = (ExternalSelectDesc)
palloc0(sizeof(ExternalSelectDescData));
+ Plan *rootPlan;
if (state != NULL)
{
desc->projInfo = state->ps_ProjInfo;
+ /*
+ * If we have an agg type then our parent is an Agg node
+ */
+ rootPlan = state->state->es_plannedstmt->planTree;
+ if (rootPlan->type == T_Agg && es_state->parent_agg_type) {
--- End diff --
Recommend to use `IsA(rootPlan, Agg)`
---
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.
---