Merge pull request #3414 from citusdata/small_fixes

Change DistributedResultFragment::nodeId to uint32.
pull/3421/head
Hadi Moshayedi 2020-01-23 10:05:04 -08:00 committed by GitHub
commit 4fbf9a290a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -37,8 +37,8 @@
*/ */
typedef struct NodePair typedef struct NodePair
{ {
int sourceNodeId; uint32 sourceNodeId;
int targetNodeId; uint32 targetNodeId;
} NodePair; } NodePair;
@ -214,7 +214,7 @@ WrapTasksForPartitioning(char *resultIdPrefix, List *selectTaskList,
ShardPlacement *shardPlacement = lfirst(placementCell); ShardPlacement *shardPlacement = lfirst(placementCell);
StringInfo wrappedQuery = makeStringInfo(); StringInfo wrappedQuery = makeStringInfo();
appendStringInfo(wrappedQuery, appendStringInfo(wrappedQuery,
"SELECT %d, partition_index" "SELECT %u, partition_index"
", %s || '_' || partition_index::text " ", %s || '_' || partition_index::text "
", rows_written " ", rows_written "
"FROM worker_partition_query_result" "FROM worker_partition_query_result"
@ -370,8 +370,8 @@ TupleToDistributedResultFragment(TupleTableSlot *tupleSlot,
DistTableCacheEntry *targetRelation) DistTableCacheEntry *targetRelation)
{ {
bool isNull = false; bool isNull = false;
int sourceNodeId = DatumGetInt32(slot_getattr(tupleSlot, 1, &isNull)); uint32 sourceNodeId = DatumGetUInt32(slot_getattr(tupleSlot, 1, &isNull));
int targetShardIndex = DatumGetInt32(slot_getattr(tupleSlot, 2, &isNull)); uint32 targetShardIndex = DatumGetUInt32(slot_getattr(tupleSlot, 2, &isNull));
text *resultId = DatumGetTextP(slot_getattr(tupleSlot, 3, &isNull)); text *resultId = DatumGetTextP(slot_getattr(tupleSlot, 3, &isNull));
int64 rowCount = DatumGetInt64(slot_getattr(tupleSlot, 4, &isNull)); int64 rowCount = DatumGetInt64(slot_getattr(tupleSlot, 4, &isNull));
@ -533,7 +533,7 @@ FragmentTransferTaskList(List *fragmentListTransfers)
{ {
NodeToNodeFragmentsTransfer *fragmentsTransfer = lfirst(transferCell); NodeToNodeFragmentsTransfer *fragmentsTransfer = lfirst(transferCell);
int targetNodeId = fragmentsTransfer->nodes.targetNodeId; uint32 targetNodeId = fragmentsTransfer->nodes.targetNodeId;
/* these should have already been pruned away in ColocationTransfers */ /* these should have already been pruned away in ColocationTransfers */
Assert(targetNodeId != fragmentsTransfer->nodes.sourceNodeId); Assert(targetNodeId != fragmentsTransfer->nodes.sourceNodeId);

View File

@ -88,9 +88,9 @@ partition_task_list_results(PG_FUNCTION_ARGS)
bool columnNulls[5] = { 0 }; bool columnNulls[5] = { 0 };
Datum columnValues[5] = { Datum columnValues[5] = {
CStringGetTextDatum(fragment->resultId), CStringGetTextDatum(fragment->resultId),
Int32GetDatum(fragment->nodeId), UInt32GetDatum(fragment->nodeId),
Int64GetDatum(fragment->rowCount), Int64GetDatum(fragment->rowCount),
Int64GetDatum(fragment->targetShardId), UInt64GetDatum(fragment->targetShardId),
Int32GetDatum(fragment->targetShardIndex) Int32GetDatum(fragment->targetShardIndex)
}; };

View File

@ -31,7 +31,7 @@ typedef struct DistributedResultFragment
char *resultId; char *resultId;
/* location of the result */ /* location of the result */
int nodeId; uint32 nodeId;
/* number of rows in the result file */ /* number of rows in the result file */
int rowCount; int rowCount;