mirror of https://github.com/citusdata/citus.git
Make minor changes
parent
e0559ceaad
commit
a2de41fe14
|
@ -156,7 +156,7 @@ CitusCopyFrom(CopyStmt *copyStatement, char *completionTag)
|
||||||
HTAB *shardConnectionHash = NULL;
|
HTAB *shardConnectionHash = NULL;
|
||||||
List *connectionList = NIL;
|
List *connectionList = NIL;
|
||||||
MemoryContext tupleContext = NULL;
|
MemoryContext tupleContext = NULL;
|
||||||
MemoryContext outputContext = NULL;
|
MemoryContext outputRowContext = NULL;
|
||||||
CopyState copyState = NULL;
|
CopyState copyState = NULL;
|
||||||
TupleDesc tupleDescriptor = NULL;
|
TupleDesc tupleDescriptor = NULL;
|
||||||
uint32 columnCount = 0;
|
uint32 columnCount = 0;
|
||||||
|
@ -290,23 +290,25 @@ CitusCopyFrom(CopyStmt *copyStatement, char *completionTag)
|
||||||
* files.
|
* files.
|
||||||
*/
|
*/
|
||||||
tupleContext = AllocSetContextCreate(CurrentMemoryContext,
|
tupleContext = AllocSetContextCreate(CurrentMemoryContext,
|
||||||
"COPY Row Memory Context",
|
"COPY FROM Row Memory Context",
|
||||||
ALLOCSET_DEFAULT_MINSIZE,
|
ALLOCSET_DEFAULT_MINSIZE,
|
||||||
ALLOCSET_DEFAULT_INITSIZE,
|
ALLOCSET_DEFAULT_INITSIZE,
|
||||||
ALLOCSET_DEFAULT_MAXSIZE);
|
ALLOCSET_DEFAULT_MAXSIZE);
|
||||||
|
|
||||||
outputContext = AllocSetContextCreate(CurrentMemoryContext,
|
/* we use outputRowContext to serialize row to send to workers */
|
||||||
"COPY Output Memory Context",
|
outputRowContext = AllocSetContextCreate(CurrentMemoryContext,
|
||||||
|
"COPY TO Row Memory Context",
|
||||||
ALLOCSET_DEFAULT_MINSIZE,
|
ALLOCSET_DEFAULT_MINSIZE,
|
||||||
ALLOCSET_DEFAULT_INITSIZE,
|
ALLOCSET_DEFAULT_INITSIZE,
|
||||||
ALLOCSET_DEFAULT_MAXSIZE);
|
ALLOCSET_DEFAULT_MAXSIZE);
|
||||||
|
|
||||||
columnOutputFunctions = ColumnOutputFunctions(tupleDescriptor, true);
|
|
||||||
|
|
||||||
rowOutputState = (OutputCopyState) palloc0(sizeof(OutputCopyStateData));
|
rowOutputState = (OutputCopyState) palloc0(sizeof(OutputCopyStateData));
|
||||||
rowOutputState->binary = true;
|
rowOutputState->binary = true;
|
||||||
rowOutputState->fe_msgbuf = makeStringInfo();
|
rowOutputState->fe_msgbuf = makeStringInfo();
|
||||||
rowOutputState->rowcontext = outputContext;
|
rowOutputState->rowcontext = outputRowContext;
|
||||||
|
|
||||||
|
columnOutputFunctions = ColumnOutputFunctions(tupleDescriptor,
|
||||||
|
rowOutputState->binary);
|
||||||
|
|
||||||
/* we use a PG_TRY block to roll back on errors (e.g. in NextCopyFrom) */
|
/* we use a PG_TRY block to roll back on errors (e.g. in NextCopyFrom) */
|
||||||
PG_TRY();
|
PG_TRY();
|
||||||
|
|
|
@ -43,13 +43,13 @@ typedef struct OutputCopyStateData
|
||||||
|
|
||||||
typedef struct OutputCopyStateData *OutputCopyState;
|
typedef struct OutputCopyStateData *OutputCopyState;
|
||||||
|
|
||||||
|
|
||||||
|
/* function declarations for copying into a distributed table */
|
||||||
extern FmgrInfo * ColumnOutputFunctions(TupleDesc rowDescriptor, bool binaryFormat);
|
extern FmgrInfo * ColumnOutputFunctions(TupleDesc rowDescriptor, bool binaryFormat);
|
||||||
extern void OutputRow(Datum *valueArray, bool *isNullArray, TupleDesc rowDescriptor,
|
extern void OutputRow(Datum *valueArray, bool *isNullArray, TupleDesc rowDescriptor,
|
||||||
OutputCopyState rowOutputState, FmgrInfo *columnOutputFunctions);
|
OutputCopyState rowOutputState, FmgrInfo *columnOutputFunctions);
|
||||||
extern void CopySendBinaryHeaders(OutputCopyState headerOutputState);
|
extern void CopySendBinaryHeaders(OutputCopyState headerOutputState);
|
||||||
extern void CopySendBinaryFooters(OutputCopyState footerOutputState);
|
extern void CopySendBinaryFooters(OutputCopyState footerOutputState);
|
||||||
|
|
||||||
/* function declarations for copying into a distributed table */
|
|
||||||
extern void CitusCopyFrom(CopyStmt *copyStatement, char *completionTag);
|
extern void CitusCopyFrom(CopyStmt *copyStatement, char *completionTag);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue