提交 5b6ca20f 编写于 作者: H Haojun Liao

[td-225] refactor codes.

上级 25b2cec2
...@@ -69,17 +69,12 @@ typedef struct SJoinSupporter { ...@@ -69,17 +69,12 @@ typedef struct SJoinSupporter {
SSubqueryState* pState; SSubqueryState* pState;
SSqlObj* pObj; // parent SqlObj SSqlObj* pObj; // parent SqlObj
int32_t subqueryIndex; // index of sub query int32_t subqueryIndex; // index of sub query
char intervalTimeUnit;
char slidingTimeUnit;
int64_t intervalTime; // interval time
int64_t slidingTime; // sliding time
SLimitVal limit; // limit info SLimitVal limit; // limit info
uint64_t uid; // query meter uid uint64_t uid; // query table uid
SArray* colList; // previous query information, no need to use this attribute, and the corresponding attribution SArray* colList; // previous query information, no need to use this attribute, and the corresponding attribution
SArray* exprList; SArray* exprList;
SFieldInfo fieldsInfo; SFieldInfo fieldsInfo;
STagCond tagCond; STagCond tagCond;
SSqlGroupbyExpr groupbyExpr;
struct STSBuf* pTSBuf; // the TSBuf struct that holds the compressed timestamp array struct STSBuf* pTSBuf; // the TSBuf struct that holds the compressed timestamp array
FILE* f; // temporary file in order to create TSBuf FILE* f; // temporary file in order to create TSBuf
char path[PATH_MAX]; // temporary file path, todo dynamic allocate memory char path[PATH_MAX]; // temporary file path, todo dynamic allocate memory
......
...@@ -178,10 +178,6 @@ SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, SSubqueryState* pState, in ...@@ -178,10 +178,6 @@ SJoinSupporter* tscCreateJoinSupporter(SSqlObj* pSql, SSubqueryState* pState, in
pSupporter->subqueryIndex = index; pSupporter->subqueryIndex = index;
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, pSql->cmd.clauseIndex); SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, pSql->cmd.clauseIndex);
pSupporter->intervalTimeUnit = pQueryInfo->intervalTimeUnit;
pSupporter->slidingTime = pQueryInfo->slidingTimeUnit;
pSupporter->intervalTime = pQueryInfo->intervalTime;
pSupporter->slidingTime = pQueryInfo->slidingTime;
pSupporter->limit = pQueryInfo->limit; pSupporter->limit = pQueryInfo->limit;
STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, pSql->cmd.clauseIndex, index); STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(&pSql->cmd, pSql->cmd.clauseIndex, index);
...@@ -311,18 +307,12 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { ...@@ -311,18 +307,12 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
// set the second stage sub query for join process // set the second stage sub query for join process
TSDB_QUERY_SET_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_JOIN_SEC_STAGE); TSDB_QUERY_SET_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_JOIN_SEC_STAGE);
pQueryInfo->intervalTimeUnit = pSupporter->intervalTimeUnit;
pQueryInfo->slidingTimeUnit = pSupporter->slidingTimeUnit;
pQueryInfo->intervalTime = pSupporter->intervalTime;
pQueryInfo->slidingTime = pSupporter->slidingTime;
pQueryInfo->groupbyExpr = pSupporter->groupbyExpr;
tscTagCondCopy(&pQueryInfo->tagCond, &pSupporter->tagCond); tscTagCondCopy(&pQueryInfo->tagCond, &pSupporter->tagCond);
pQueryInfo->colList = pSupporter->colList; pQueryInfo->colList = pSupporter->colList;
pQueryInfo->exprList = pSupporter->exprList; pQueryInfo->exprList = pSupporter->exprList;
pQueryInfo->fieldsInfo = pSupporter->fieldsInfo; pQueryInfo->fieldsInfo = pSupporter->fieldsInfo;
pSupporter->exprList = NULL; pSupporter->exprList = NULL;
pSupporter->colList = NULL; pSupporter->colList = NULL;
memset(&pSupporter->fieldsInfo, 0, sizeof(SFieldInfo)); memset(&pSupporter->fieldsInfo, 0, sizeof(SFieldInfo));
...@@ -1221,7 +1211,6 @@ int32_t tscCreateJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter ...@@ -1221,7 +1211,6 @@ int32_t tscCreateJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter
pNewQueryInfo->limit.offset = 0; pNewQueryInfo->limit.offset = 0;
// backup the data and clear it in the sqlcmd object // backup the data and clear it in the sqlcmd object
pSupporter->groupbyExpr = pNewQueryInfo->groupbyExpr;
memset(&pNewQueryInfo->groupbyExpr, 0, sizeof(SSqlGroupbyExpr)); memset(&pNewQueryInfo->groupbyExpr, 0, sizeof(SSqlGroupbyExpr));
tscInitQueryInfo(pNewQueryInfo); tscInitQueryInfo(pNewQueryInfo);
......
...@@ -1534,7 +1534,6 @@ void tscInitQueryInfo(SQueryInfo* pQueryInfo) { ...@@ -1534,7 +1534,6 @@ void tscInitQueryInfo(SQueryInfo* pQueryInfo) {
pQueryInfo->exprList = taosArrayInit(4, POINTER_BYTES); pQueryInfo->exprList = taosArrayInit(4, POINTER_BYTES);
pQueryInfo->colList = taosArrayInit(4, POINTER_BYTES); pQueryInfo->colList = taosArrayInit(4, POINTER_BYTES);
pQueryInfo->udColumnId = TSDB_UD_COLUMN_INDEX; pQueryInfo->udColumnId = TSDB_UD_COLUMN_INDEX;
pQueryInfo->window = TSWINDOW_INITIALIZER;
} }
int32_t tscAddSubqueryInfo(SSqlCmd* pCmd) { int32_t tscAddSubqueryInfo(SSqlCmd* pCmd) {
...@@ -1555,6 +1554,8 @@ int32_t tscAddSubqueryInfo(SSqlCmd* pCmd) { ...@@ -1555,6 +1554,8 @@ int32_t tscAddSubqueryInfo(SSqlCmd* pCmd) {
} }
tscInitQueryInfo(pQueryInfo); tscInitQueryInfo(pQueryInfo);
pQueryInfo->window = TSWINDOW_INITIALIZER;
pQueryInfo->msg = pCmd->payload; // pointer to the parent error message buffer pQueryInfo->msg = pCmd->payload; // pointer to the parent error message buffer
pCmd->pQueryInfo[pCmd->numOfClause++] = pQueryInfo; pCmd->pQueryInfo[pCmd->numOfClause++] = pQueryInfo;
......
...@@ -1177,7 +1177,7 @@ static int32_t doTSJoinFilter(SQueryRuntimeEnv *pRuntimeEnv, int32_t offset) { ...@@ -1177,7 +1177,7 @@ static int32_t doTSJoinFilter(SQueryRuntimeEnv *pRuntimeEnv, int32_t offset) {
#if defined(_DEBUG_VIEW) #if defined(_DEBUG_VIEW)
printf("elem in comp ts file:%" PRId64 ", key:%" PRId64 ", tag:%"PRIu64", query order:%d, ts order:%d, traverse:%d, index:%d\n", printf("elem in comp ts file:%" PRId64 ", key:%" PRId64 ", tag:%"PRIu64", query order:%d, ts order:%d, traverse:%d, index:%d\n",
elem.ts, key, elem.tag, pQuery->order.order, pRuntimeEnv->pTSBuf->tsOrder, elem.ts, key, elem.tag.i64Key, pQuery->order.order, pRuntimeEnv->pTSBuf->tsOrder,
pRuntimeEnv->pTSBuf->cur.order, pRuntimeEnv->pTSBuf->cur.tsIndex); pRuntimeEnv->pTSBuf->cur.order, pRuntimeEnv->pTSBuf->cur.tsIndex);
#endif #endif
......
...@@ -205,10 +205,12 @@ if $rows != 9 then ...@@ -205,10 +205,12 @@ if $rows != 9 then
endi endi
if $data00 != @70-01-01 08:01:40.100@ then if $data00 != @70-01-01 08:01:40.100@ then
print $data00
return -1 return -1
endi endi
if $data10 != @70-01-01 08:01:40.200@ then if $data10 != @70-01-01 08:01:40.200@ then
print $data10
return -1 return -1
endi endi
......
sleep 2000 #sleep 2000
run general/parser/alter.sim #run general/parser/alter.sim
sleep 2000 #sleep 2000
run general/parser/alter1.sim #run general/parser/alter1.sim
sleep 2000 #sleep 2000
run general/parser/alter_stable.sim #run general/parser/alter_stable.sim
sleep 2000 #sleep 2000
run general/parser/auto_create_tb.sim #run general/parser/auto_create_tb.sim
sleep 2000 #sleep 2000
run general/parser/auto_create_tb_drop_tb.sim #run general/parser/auto_create_tb_drop_tb.sim
sleep 2000 #sleep 2000
run general/parser/col_arithmetic_operation.sim #run general/parser/col_arithmetic_operation.sim
sleep 2000 #sleep 2000
run general/parser/columnValue.sim #run general/parser/columnValue.sim
sleep 2000 #sleep 2000
run general/parser/commit.sim #run general/parser/commit.sim
sleep 2000 #sleep 2000
run general/parser/create_db.sim #run general/parser/create_db.sim
sleep 2000 #sleep 2000
run general/parser/create_mt.sim #run general/parser/create_mt.sim
sleep 2000 #sleep 2000
run general/parser/create_tb.sim #run general/parser/create_tb.sim
sleep 2000 #sleep 2000
run general/parser/dbtbnameValidate.sim #run general/parser/dbtbnameValidate.sim
sleep 2000 #sleep 2000
run general/parser/fill.sim #run general/parser/fill.sim
sleep 2000 #sleep 2000
run general/parser/fill_stb.sim #run general/parser/fill_stb.sim
sleep 2000 #sleep 2000
#run general/parser/fill_us.sim # ##run general/parser/fill_us.sim #
sleep 2000 #sleep 2000
run general/parser/first_last.sim #run general/parser/first_last.sim
sleep 2000 #sleep 2000
run general/parser/import_commit1.sim #run general/parser/import_commit1.sim
sleep 2000 #sleep 2000
run general/parser/import_commit2.sim #run general/parser/import_commit2.sim
sleep 2000 #sleep 2000
run general/parser/import_commit3.sim #run general/parser/import_commit3.sim
sleep 2000 #sleep 2000
#run general/parser/import_file.sim ##run general/parser/import_file.sim
sleep 2000 #sleep 2000
run general/parser/insert_tb.sim #run general/parser/insert_tb.sim
sleep 2000 #sleep 2000
run general/parser/tags_dynamically_specifiy.sim #run general/parser/tags_dynamically_specifiy.sim
sleep 2000 #sleep 2000
run general/parser/interp.sim #run general/parser/interp.sim
sleep 2000 #sleep 2000
run general/parser/lastrow.sim #run general/parser/lastrow.sim
sleep 2000 #sleep 2000
run general/parser/limit.sim #run general/parser/limit.sim
sleep 2000 #sleep 2000
run general/parser/limit1.sim #run general/parser/limit1.sim
sleep 2000 #sleep 2000
run general/parser/limit1_tblocks100.sim #run general/parser/limit1_tblocks100.sim
sleep 2000 #sleep 2000
run general/parser/limit2.sim #run general/parser/limit2.sim
sleep 2000 #sleep 2000
run general/parser/mixed_blocks.sim #run general/parser/mixed_blocks.sim
sleep 2000 #sleep 2000
run general/parser/nchar.sim #run general/parser/nchar.sim
sleep 2000 #sleep 2000
run general/parser/null_char.sim #run general/parser/null_char.sim
sleep 2000 #sleep 2000
run general/parser/selectResNum.sim #run general/parser/selectResNum.sim
sleep 2000 #sleep 2000
run general/parser/select_across_vnodes.sim #run general/parser/select_across_vnodes.sim
sleep 2000 #sleep 2000
run general/parser/select_from_cache_disk.sim #run general/parser/select_from_cache_disk.sim
sleep 2000 #sleep 2000
run general/parser/set_tag_vals.sim #run general/parser/set_tag_vals.sim
sleep 2000 #sleep 2000
run general/parser/single_row_in_tb.sim #run general/parser/single_row_in_tb.sim
sleep 2000 #sleep 2000
run general/parser/slimit.sim #run general/parser/slimit.sim
sleep 2000 #sleep 2000
run general/parser/slimit1.sim #run general/parser/slimit1.sim
sleep 2000 #sleep 2000
run general/parser/slimit_alter_tags.sim #run general/parser/slimit_alter_tags.sim
sleep 2000 #sleep 2000
run general/parser/tbnameIn.sim #run general/parser/tbnameIn.sim
sleep 2000 #sleep 2000
run general/parser/slimit_alter_tags.sim # persistent failed #run general/parser/slimit_alter_tags.sim # persistent failed
sleep 2000 #sleep 2000
run general/parser/join.sim #run general/parser/join.sim
sleep 2000 sleep 2000
run general/parser/join_multivnode.sim run general/parser/join_multivnode.sim
sleep 2000 sleep 2000
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册