Github user wengyanqing commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/1360#discussion_r186347995 --- Diff: src/backend/executor/nodeHashjoin.c --- @@ -776,6 +802,33 @@ ExecEndHashJoin(HashJoinState *node) EndPlanStateGpmonPkt(&node->js.ps); } +/* + * Create runtime filter state for scan node. + * TODO: how to pass it across motion + */ +static void +CreateRuntimeFilterState(RuntimeFilterState* rf, HashJoinState *hjstate) +{ + /* record projection info */ + ListCell *hk; + int i = 0; + foreach(hk, hjstate->hj_OuterHashKeys) + { + ExprState *keyexpr = (ExprState *) lfirst(hk); + Var *variable = (Var *) keyexpr->expr; + rf->joinkeys = lappend_int(rf->joinkeys, variable->varattno); + i++; + } + rf->hashfunctions = (FmgrInfo *) palloc(i * sizeof(FmgrInfo)); + memcpy(rf->hashfunctions, hjstate->hj_HashTable->hashfunctions, i*sizeof(FmgrInfo)); + size_t size = offsetof(BloomFilterData, data) + hjstate->hj_HashTable->bloomfilter->data_size; + rf->bloomfilter = palloc0(size); + memcpy(rf->bloomfilter, hjstate->hj_HashTable->bloomfilter, size); --- End diff -- Why not just assign hjstate->hj_HashTable->bloomfilter to rf->bloomfilter ?
---