提交 9b76c49d 编写于 作者: H Haojun Liao

[td-225] refactor

上级 9b224d9b
...@@ -235,15 +235,19 @@ typedef struct SQuery { ...@@ -235,15 +235,19 @@ typedef struct SQuery {
void* tsdb; void* tsdb;
SMemRef memRef; SMemRef memRef;
STableGroupInfo tableGroupInfo; // table <tid, last_key> list SArray<STableKeyInfo> STableGroupInfo tableGroupInfo; // table <tid, last_key> list SArray<STableKeyInfo>
int32_t vgId;
} SQuery; } SQuery;
typedef SSDataBlock* (*__operator_fn_t)(void* param); typedef SSDataBlock* (*__operator_fn_t)(void* param);
typedef struct SOperatorInfo { typedef struct SOperatorInfo {
char *name; char *name;
bool blockingOptr; bool blockingOptr;
void *optInfo; bool completed;
void *optInfo;
SExprInfo *pExpr;
int32_t numOfOutput;
__operator_fn_t exec; __operator_fn_t exec;
struct SOperatorInfo *upstream; struct SOperatorInfo *upstream;
} SOperatorInfo; } SOperatorInfo;
...@@ -284,6 +288,7 @@ typedef struct SQueryRuntimeEnv { ...@@ -284,6 +288,7 @@ typedef struct SQueryRuntimeEnv {
int32_t groupIndex; int32_t groupIndex;
int32_t tableIndex; int32_t tableIndex;
STableGroupInfo tableqinfoGroupInfo; // this is a group array list, including SArray<STableQueryInfo*> structure STableGroupInfo tableqinfoGroupInfo; // this is a group array list, including SArray<STableQueryInfo*> structure
SOperatorInfo* proot;
} SQueryRuntimeEnv; } SQueryRuntimeEnv;
typedef struct { typedef struct {
...@@ -301,8 +306,6 @@ typedef struct SQInfo { ...@@ -301,8 +306,6 @@ typedef struct SQInfo {
int32_t code; // error code to returned to client int32_t code; // error code to returned to client
int64_t owner; // if it is in execution int64_t owner; // if it is in execution
int32_t vgId;
SQueryRuntimeEnv runtimeEnv; SQueryRuntimeEnv runtimeEnv;
SQuery query; SQuery query;
...@@ -365,13 +368,27 @@ typedef struct SAggOperatorInfo { ...@@ -365,13 +368,27 @@ typedef struct SAggOperatorInfo {
SResultRowInfo *pResultRowInfo; SResultRowInfo *pResultRowInfo;
STableQueryInfo *pTableQueryInfo; STableQueryInfo *pTableQueryInfo;
SQueryRuntimeEnv *pRuntimeEnv; SQueryRuntimeEnv *pRuntimeEnv;
SQLFunctionCtx *pCtx;
} SAggOperatorInfo; } SAggOperatorInfo;
typedef struct SArithOperatorInfo { typedef struct SArithOperatorInfo {
STableQueryInfo *pTableQueryInfo; STableQueryInfo *pTableQueryInfo;
SQueryRuntimeEnv *pRuntimeEnv; SQueryRuntimeEnv *pRuntimeEnv;
SQLFunctionCtx* pCtx;
} SArithOperatorInfo; } SArithOperatorInfo;
typedef struct SLimitOperatorInfo {
int64_t limit;
int64_t total;
SQueryRuntimeEnv* pRuntimeEnv;
} SLimitOperatorInfo;
typedef struct SOffsetOperatorInfo {
int64_t offset;
int64_t currentOffset;
SQueryRuntimeEnv* pRuntimeEnv;
} SOffsetOperatorInfo;
void freeParam(SQueryParam *param); void freeParam(SQueryParam *param);
int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param); int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param);
int32_t createQueryFuncExprFromMsg(SQueryTableMsg *pQueryMsg, int32_t numOfOutput, SExprInfo **pExprInfo, SSqlFuncMsg **pExprMsg, int32_t createQueryFuncExprFromMsg(SQueryTableMsg *pQueryMsg, int32_t numOfOutput, SExprInfo **pExprInfo, SSqlFuncMsg **pExprMsg,
......
...@@ -3564,7 +3564,7 @@ char *getArithColumnData(void *param, const char* name, int32_t colId) { ...@@ -3564,7 +3564,7 @@ char *getArithColumnData(void *param, const char* name, int32_t colId) {
} }
} }
assert(index >= 0 && colId >= 0); assert(index >= 0 /*&& colId >= 0*/);
return pSupport->data[index] + pSupport->offset * pSupport->colList[index].bytes; return pSupport->data[index] + pSupport->offset * pSupport->colList[index].bytes;
} }
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册