before using ssdatablock for udfd/udfdc communication

This commit is contained in:
slzhou 2022-04-16 14:19:33 +08:00
parent 7ed7624306
commit 4e6caa3495
4 changed files with 9 additions and 3 deletions

View File

@ -125,6 +125,11 @@ int32_t teardownUdf(UdfHandle handle);
typedef int32_t (*TUdfSetupFunc)();
typedef int32_t (*TUdfTeardownFunc)();
//TODO: another way to manage memory is provide api for UDF to add data to SUdfColumnData and UDF framework will allocate memory.
// then UDF framework will free the memory
//typedef int32_t addFixedLengthColumnData(SColumnData *columnData, int rowIndex, bool isNull, int32_t colBytes, char* data);
//typedef int32_t addVariableLengthColumnData(SColumnData *columnData, int rowIndex, bool isNull, int32_t dataLen, char * data);
typedef int32_t (*TUdfFreeUdfColumnDataFunc)(SUdfColumnData* columnData);
typedef int32_t (*TUdfScalarProcFunc)(SUdfDataBlock block, SUdfColumnData *resultData);

View File

@ -51,6 +51,7 @@ typedef struct SUdfCallRequest {
SUdfDataBlock block;
SUdfInterBuf interBuf;
SUdfInterBuf interBuf2;
bool initFirst;
} SUdfCallRequest;

View File

@ -372,7 +372,6 @@ int32_t serializeUdfInterBuf(SUdfInterBuf *state, char *pBuf) {
*(int32_t*)pBuf = state->bufLen;
pBuf += sizeof(int32_t);
memcpy(pBuf, state->buf, state->bufLen);
pBuf += state->bufLen;
@ -463,6 +462,8 @@ int32_t serializeUdfCallRequest(SUdfCallRequest *call, char *buf) {
buf += l;
l = serializeUdfInterBuf(&call->interBuf, buf);
buf += l;
l = serializeUdfInterBuf(&call->interBuf2, buf);
buf += l;
*(bool*)buf = call->initFirst;
buf += sizeof(bool);
@ -1253,8 +1254,6 @@ int32_t callUdf(UdfHandle handle, int8_t callType, SUdfDataBlock *input, SUdfInt
}
}
udfcRunUvTask(task, UV_TASK_REQ_RSP);
SUdfCallResponse *rsp = &task->_call.rsp;

View File

@ -393,6 +393,7 @@ int32_t closeUdfdClientRpc(SUdfdContext *ctx) {
return 0;
}
int main() {
debugPrint("libuv version: %x", UV_VERSION_HEX);