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

TD-6129<feature> add tag?'key' in where logic

上级 e45a3d85
......@@ -1188,7 +1188,8 @@ int32_t filterAddGroupUnitFromNode(SFilterInfo *info, tExprNode* tree, SArray *g
tExprNode* pLeft = tree->_node.pLeft;
if(pLeft->nodeType == TSQL_NODE_EXPR && pLeft->_node.optr == TSDB_RELATION_ARROW){ // json tag -> operation
assert(info->pTable != NULL);
void* data = getJsonTagValue(info->pTable, pLeft->_node.pLeft->pSchema->name, strlen(pLeft->_node.pLeft->pSchema->name));
SSchema* schema = FILTER_GET_COL_FIELD_DESC(FILTER_GET_FIELD(info, left));
void* data = getJsonTagValue(info->pTable, schema->name, strlen(schema->name));
if(data == NULL) return TSDB_CODE_QRY_JSON_KEY_NOT_EXIST;
type = *(char*)data;
assert(type > TSDB_DATA_TYPE_NULL && type < TSDB_DATA_TYPE_JSON);
......
......@@ -3783,17 +3783,18 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons
void *filterInfo = calloc(1, sizeof(SFilterInfo));
((SFilterInfo*)filterInfo)->pTable = pTable;
ret = filterInitFromTree(expr, &filterInfo, 0);
tExprTreeDestroy(expr, NULL);
if (ret != TSDB_CODE_SUCCESS) {
terrno = ret;
tsdbUnlockRepoMeta(tsdb);
filterFreeInfo(filterInfo);
goto _error;
}
tsdbQueryTableList(pTable, res, filterInfo);
filterFreeInfo(filterInfo);
tExprTreeDestroy(expr, NULL);
pGroupInfo->numOfTables = (uint32_t)taosArrayGetSize(res);
pGroupInfo->pGroupList = createTableGroup(res, pTagSchema, pColIndex, numOfCols, skey);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册