// aggregate start function. The intermediate value or the state(@interBuf) is initialized in this function. The function name shall be concatenation of udf name and _start suffix
// aggregate start function. The intermediate value or the state(@interBuf) is initialized in this function. The function name shall be concatenation of udf name and _start suffix
// @param interbuf intermediate value to intialize
// @return error number defined in taoserror.h
// @return error number defined in taoserror.h
int32_taggfn_start(SUdfInterBuf*interBuf){
int32_taggfn_start(SUdfInterBuf*interBuf){
// initialize intermediate value in interBuf
returnTSDB_CODE_SUCESS;
returnTSDB_CODE_SUCESS;
}
}
// aggregate reduce function. This function aggregate old state(@interbuf) and one data bock(inputBlock) and output a new state(@newInterBuf).
// aggregate reduce function. This function aggregate old state(@interbuf) and one data bock(inputBlock) and output a new state(@newInterBuf).
// read from inputBlock and interBuf and output to newInterBuf
// read from inputBlock and interBuf and output to newInterBuf
returnTSDB_CODE_SUCCESS;
returnTSDB_CODE_SUCCESS;
}
}
// aggregate function finish function. This function transforms the intermediate value(@interBuf) into the final output(@result). The function name must be concatenation of aggfn and _finish suffix.
// aggregate function finish function. This function transforms the intermediate value(@interBuf) into the final output(@result). The function name must be concatenation of aggfn and _finish suffix.