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

fea:add select json logic

上级 91dc9e90
......@@ -832,8 +832,7 @@ static char* parseTagDatatoJson(void *p){
goto end;
}
cJSON_AddItemToObject(json, tagJsonKey, value);
}
else{
}else{
ASSERT(0);
}
......
......@@ -1467,7 +1467,6 @@ static SSDataBlock* doTagScan(SOperatorInfo* pOperator) {
STR_TO_VARSTR(str, mr.me.name);
colDataAppend(pDst, count, str, false);
} else { // it is a tag value
const char* p = NULL;
if(pDst->info.type == TSDB_DATA_TYPE_JSON){
const uint8_t *tmp = mr.me.ctbEntry.pTags;
char *data = taosMemoryCalloc(kvRowLen(tmp) + 1, 1);
......@@ -1477,11 +1476,12 @@ static SSDataBlock* doTagScan(SOperatorInfo* pOperator) {
}
*data = TSDB_DATA_TYPE_JSON;
memcpy(data+1, tmp, kvRowLen(tmp));
p = data;
colDataAppend(pDst, count, data, false);
taosMemoryFree(data);
}else{
p = metaGetTableTagVal(&mr.me, pExprInfo[j].base.pParam[0].pCol->colId);
const char* p = metaGetTableTagVal(&mr.me, pExprInfo[j].base.pParam[0].pCol->colId);
colDataAppend(pDst, count, p, (p == NULL));
}
colDataAppend(pDst, count, p, (p == NULL));
}
}
......
......@@ -923,6 +923,7 @@ static void doReleaseVec(SColumnInfoData* pCol, int32_t type) {
}
char *getJsonValue(char *json, char *key){
json++; // jump type
int16_t cols = kvRowNCols(json);
for (int i = 0; i < cols; ++i) {
SColIdx *pColIdx = kvRowColIdxAt(json, i);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册