提交 dea42054 编写于 作者: wmmhello's avatar wmmhello

optimize code

上级 2ea5bdc6
...@@ -6615,21 +6615,19 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -6615,21 +6615,19 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
} }
SKVRowBuilder kvRowBuilder = {0}; SKVRowBuilder kvRowBuilder = {0};
if (pTagsSchema->type == TSDB_DATA_TYPE_JSON) { if (pTagsSchema->type == TSDB_DATA_TYPE_JSON) {
if (tdInitKVRowBuilder(&kvRowBuilder) < 0) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
if (pItem->pVar.nType != TSDB_DATA_TYPE_BINARY) { if (pItem->pVar.nType != TSDB_DATA_TYPE_BINARY) {
tscError("json type error, should be string"); tscError("json type error, should be string");
tdDestroyKVRowBuilder(&kvRowBuilder);
return invalidOperationMsg(pMsg, msg25); return invalidOperationMsg(pMsg, msg25);
} }
if (pItem->pVar.nType > TSDB_MAX_JSON_TAGS_LEN / TSDB_NCHAR_SIZE) { if (pItem->pVar.nType > TSDB_MAX_JSON_TAGS_LEN / TSDB_NCHAR_SIZE) {
tscError("json tag too long"); tscError("json tag too long");
tdDestroyKVRowBuilder(&kvRowBuilder);
return invalidOperationMsg(pMsg, msg14); return invalidOperationMsg(pMsg, msg14);
} }
if (tdInitKVRowBuilder(&kvRowBuilder) < 0) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
int8_t tagVal = TSDB_DATA_JSON_PLACEHOLDER; int8_t tagVal = TSDB_DATA_JSON_PLACEHOLDER;
tdAddColToKVRow(&kvRowBuilder, pTagsSchema->colId, pTagsSchema->type, &tagVal, false); tdAddColToKVRow(&kvRowBuilder, pTagsSchema->colId, pTagsSchema->type, &tagVal, false);
......
...@@ -1549,8 +1549,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul ...@@ -1549,8 +1549,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul
} }
ekey = reviseWindowEkey(pQueryAttr, &nextWin); ekey = reviseWindowEkey(pQueryAttr, &nextWin);
forwardStep = forwardStep = getNumOfRowsInTimeWindow(pRuntimeEnv, &pSDataBlock->info, tsCols, startPos, ekey, binarySearchForKey, true);
getNumOfRowsInTimeWindow(pRuntimeEnv, &pSDataBlock->info, tsCols, startPos, ekey, binarySearchForKey, true);
// window start(end) key interpolation // window start(end) key interpolation
doWindowBorderInterpolation(pOperatorInfo, pSDataBlock, pInfo->pCtx, pResult, &nextWin, startPos, forwardStep); doWindowBorderInterpolation(pOperatorInfo, pSDataBlock, pInfo->pCtx, pResult, &nextWin, startPos, forwardStep);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册