提交 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 ...@@ -1188,7 +1188,8 @@ int32_t filterAddGroupUnitFromNode(SFilterInfo *info, tExprNode* tree, SArray *g
tExprNode* pLeft = tree->_node.pLeft; tExprNode* pLeft = tree->_node.pLeft;
if(pLeft->nodeType == TSQL_NODE_EXPR && pLeft->_node.optr == TSDB_RELATION_ARROW){ // json tag -> operation if(pLeft->nodeType == TSQL_NODE_EXPR && pLeft->_node.optr == TSDB_RELATION_ARROW){ // json tag -> operation
assert(info->pTable != NULL); 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; if(data == NULL) return TSDB_CODE_QRY_JSON_KEY_NOT_EXIST;
type = *(char*)data; type = *(char*)data;
assert(type > TSDB_DATA_TYPE_NULL && type < TSDB_DATA_TYPE_JSON); assert(type > TSDB_DATA_TYPE_NULL && type < TSDB_DATA_TYPE_JSON);
......
...@@ -3783,9 +3783,12 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons ...@@ -3783,9 +3783,12 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons
void *filterInfo = calloc(1, sizeof(SFilterInfo)); void *filterInfo = calloc(1, sizeof(SFilterInfo));
((SFilterInfo*)filterInfo)->pTable = pTable; ((SFilterInfo*)filterInfo)->pTable = pTable;
ret = filterInitFromTree(expr, &filterInfo, 0); ret = filterInitFromTree(expr, &filterInfo, 0);
tExprTreeDestroy(expr, NULL);
if (ret != TSDB_CODE_SUCCESS) { if (ret != TSDB_CODE_SUCCESS) {
terrno = ret; terrno = ret;
tsdbUnlockRepoMeta(tsdb); tsdbUnlockRepoMeta(tsdb);
filterFreeInfo(filterInfo);
goto _error; goto _error;
} }
...@@ -3793,8 +3796,6 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons ...@@ -3793,8 +3796,6 @@ int32_t tsdbQuerySTableByTagCond(STsdbRepo* tsdb, uint64_t uid, TSKEY skey, cons
filterFreeInfo(filterInfo); filterFreeInfo(filterInfo);
tExprTreeDestroy(expr, NULL);
pGroupInfo->numOfTables = (uint32_t)taosArrayGetSize(res); pGroupInfo->numOfTables = (uint32_t)taosArrayGetSize(res);
pGroupInfo->pGroupList = createTableGroup(res, pTagSchema, pColIndex, numOfCols, skey); 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.
先完成此消息的编辑!
想要评论请 注册