mirror of https://github.com/citusdata/citus.git
Refactor ScanStateGetTupleDescriptor() into a function.
parent
7abd28d3e8
commit
0b01c59fa6
|
@ -318,3 +318,14 @@ CitusReScan(CustomScanState *node)
|
|||
"parameters are currently unsupported")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ScanStateGetTupleDescriptor returns the tuple descriptor for the given
|
||||
* scan state.
|
||||
*/
|
||||
extern TupleDesc
|
||||
ScanStateGetTupleDescriptor(CitusScanState *scanState)
|
||||
{
|
||||
return scanState->customScanState.ss.ps.ps_ResultTupleSlot->tts_tupleDescriptor;
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ LoadTuplesIntoTupleStore(CitusScanState *citusScanState, Job *workerJob)
|
|||
bool interTransactions = false;
|
||||
char *copyFormat = "text";
|
||||
|
||||
tupleDescriptor = customScanState.ss.ps.ps_ResultTupleSlot->tts_tupleDescriptor;
|
||||
tupleDescriptor = ScanStateGetTupleDescriptor(citusScanState);
|
||||
|
||||
Assert(citusScanState->tuplestorestate == NULL);
|
||||
citusScanState->tuplestorestate =
|
||||
|
|
|
@ -624,8 +624,7 @@ RouterModifyExecScan(CustomScanState *node)
|
|||
static void
|
||||
SortTupleStore(CitusScanState *scanState)
|
||||
{
|
||||
TupleDesc tupleDescriptor =
|
||||
scanState->customScanState.ss.ps.ps_ResultTupleSlot->tts_tupleDescriptor;
|
||||
TupleDesc tupleDescriptor = ScanStateGetTupleDescriptor(scanState);
|
||||
Tuplestorestate *tupleStore = scanState->tuplestorestate;
|
||||
|
||||
List *targetList = scanState->customScanState.ss.ps.plan->targetlist;
|
||||
|
@ -1815,8 +1814,7 @@ StoreQueryResult(CitusScanState *scanState, MultiConnection *connection,
|
|||
bool alwaysThrowErrorOnFailure, int64 *rows,
|
||||
DistributedExecutionStats *executionStats)
|
||||
{
|
||||
TupleDesc tupleDescriptor =
|
||||
scanState->customScanState.ss.ps.ps_ResultTupleSlot->tts_tupleDescriptor;
|
||||
TupleDesc tupleDescriptor = ScanStateGetTupleDescriptor(scanState);
|
||||
AttInMetadata *attributeInputMetadata = TupleDescGetAttInMetadata(tupleDescriptor);
|
||||
List *targetList = scanState->customScanState.ss.ps.plan->targetlist;
|
||||
uint32 expectedColumnCount = ExecCleanTargetListLength(targetList);
|
||||
|
|
|
@ -37,5 +37,6 @@ extern CustomScanMethods DelayedErrorCustomScanMethods;
|
|||
extern void RegisterCitusCustomScanMethods(void);
|
||||
extern void CitusExplainScan(CustomScanState *node, List *ancestors, struct
|
||||
ExplainState *es);
|
||||
extern TupleDesc ScanStateGetTupleDescriptor(CitusScanState *scanState);
|
||||
|
||||
#endif /* CITUS_CUSTOM_SCAN_H */
|
||||
|
|
Loading…
Reference in New Issue