pass compilation before udf call refinement
This commit is contained in:
parent
7a9393093d
commit
ed597e6e54
|
@ -5,7 +5,9 @@ target_include_directories(
|
|||
function
|
||||
PUBLIC
|
||||
"${TD_SOURCE_DIR}/include/libs/function"
|
||||
"${TD_SOURCE_DIR}/inlcude/util"
|
||||
"${TD_SOURCE_DIR}/include/util"
|
||||
"${TD_SOURCE_DIR}/include/common"
|
||||
"${TD_SOURCE_DIR}/include/client"
|
||||
"${TD_SOURCE_DIR}/contrib/libuv/include"
|
||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||
)
|
||||
|
@ -22,7 +24,9 @@ target_include_directories(
|
|||
PUBLIC
|
||||
"${TD_SOURCE_DIR}/include/libs/function"
|
||||
"${TD_SOURCE_DIR}/contrib/libuv/include"
|
||||
"${TD_SOURCE_DIR}/inlcude/util"
|
||||
"${TD_SOURCE_DIR}/include/util"
|
||||
"${TD_SOURCE_DIR}/include/common"
|
||||
"${TD_SOURCE_DIR}/include/client"
|
||||
"${TD_SOURCE_DIR}/include/os"
|
||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||
)
|
||||
|
@ -38,6 +42,8 @@ target_include_directories(
|
|||
PUBLIC
|
||||
"${TD_SOURCE_DIR}/include/libs/function"
|
||||
"${TD_SOURCE_DIR}/include/util"
|
||||
"${TD_SOURCE_DIR}/include/common"
|
||||
"${TD_SOURCE_DIR}/include/client"
|
||||
"${TD_SOURCE_DIR}/include/os"
|
||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||
)
|
||||
|
@ -49,7 +55,9 @@ target_include_directories(
|
|||
PUBLIC
|
||||
"${TD_SOURCE_DIR}/include/libs/function"
|
||||
"${TD_SOURCE_DIR}/contrib/libuv/include"
|
||||
"${TD_SOURCE_DIR}/inlcude/util"
|
||||
"${TD_SOURCE_DIR}/include/util"
|
||||
"${TD_SOURCE_DIR}/include/common"
|
||||
"${TD_SOURCE_DIR}/include/client"
|
||||
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc"
|
||||
)
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ typedef void *UdfHandle;
|
|||
* @param handle, out
|
||||
* @return error code
|
||||
*/
|
||||
int32_t setupUdf(char udfName[], SEpSet epSet, UdfHandle *handle);
|
||||
int32_t setupUdf(char udfName[], SEpSet *epSet, UdfHandle *handle);
|
||||
|
||||
typedef struct SUdfColumnMeta {
|
||||
int16_t type;
|
||||
|
|
|
@ -1199,7 +1199,7 @@ int32_t udfcRunUvTask(SClientUdfTask *task, int8_t uvTaskType) {
|
|||
return task->errCode;
|
||||
}
|
||||
|
||||
int32_t setupUdf(char udfName[TSDB_FUNC_NAME_LEN], UdfHandle *handle) {
|
||||
int32_t setupUdf(char udfName[], SEpSet *epSet, UdfHandle *handle) {
|
||||
debugPrint("%s", "client setup udf");
|
||||
SClientUdfTask *task = taosMemoryMalloc(sizeof(SClientUdfTask));
|
||||
task->errCode = 0;
|
||||
|
|
|
@ -18,10 +18,10 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
fprintf(stdout, "current working directory:%s\n", path);
|
||||
strcat(path, "/libudf1.so");
|
||||
SUdfInfo udfInfo = {.udfName="udf1", .path=path};
|
||||
|
||||
UdfHandle handle;
|
||||
setupUdf(&udfInfo, &handle);
|
||||
SEpSet epSet;
|
||||
setupUdf("udf1", &epSet, &handle);
|
||||
|
||||
//char state[5000000] = "state";
|
||||
//char input[5000000] = "input";
|
||||
|
@ -31,13 +31,7 @@ int main(int argc, char *argv[]) {
|
|||
if (argc > 2) callCount = atoi(argv[2]);
|
||||
char *state = taosMemoryMalloc(dataSize);
|
||||
char *input = taosMemoryMalloc(dataSize);
|
||||
SUdfDataBlock blockInput = {.data = input, .size = dataSize};
|
||||
SUdfDataBlock blockOutput;
|
||||
char* newState;
|
||||
int32_t newStateSize;
|
||||
for (int l = 0; l < callCount; ++l) {
|
||||
callUdf(handle, 0, state, dataSize, blockInput, &newState, &newStateSize, &blockOutput);
|
||||
}
|
||||
//todo: call udf
|
||||
taosMemoryFree(state);
|
||||
taosMemoryFree(input);
|
||||
teardownUdf(handle);
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
|
||||
#include "tudf.h"
|
||||
|
||||
#undef malloc
|
||||
#define malloc malloc
|
||||
#undef free
|
||||
#define free free
|
||||
int32_t udf1_setup() {
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue