[TD-225]
This commit is contained in:
parent
d0afbae3cc
commit
3cbbc55e46
|
@ -293,33 +293,32 @@ typedef struct SResRec {
|
||||||
} SResRec;
|
} SResRec;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int64_t numOfRows; // num of results in current retrieved
|
int32_t numOfRows; // num of results in current retrieval
|
||||||
int64_t numOfRowsGroup; // num of results of current group
|
int64_t numOfRowsGroup; // num of results of current group
|
||||||
int64_t numOfTotal; // num of total results
|
int64_t numOfTotal; // num of total results
|
||||||
int64_t numOfClauseTotal; // num of total result in current subclause
|
int64_t numOfClauseTotal; // num of total result in current subclause
|
||||||
char * pRsp;
|
char * pRsp;
|
||||||
int32_t rspType;
|
int32_t rspType;
|
||||||
int32_t rspLen;
|
int32_t rspLen;
|
||||||
uint64_t qhandle;
|
uint64_t qhandle;
|
||||||
int64_t uid;
|
int64_t useconds;
|
||||||
int64_t useconds;
|
int64_t offset; // offset value from vnode during projection query of stable
|
||||||
int64_t offset; // offset value from vnode during projection query of stable
|
int32_t row;
|
||||||
int32_t row;
|
int16_t numOfCols;
|
||||||
int16_t numOfCols;
|
int16_t precision;
|
||||||
int16_t precision;
|
bool completed;
|
||||||
bool completed;
|
int32_t code;
|
||||||
int32_t code;
|
int32_t numOfGroups;
|
||||||
int32_t numOfGroups;
|
SResRec * pGroupRec;
|
||||||
SResRec * pGroupRec;
|
char * data;
|
||||||
char * data;
|
TAOS_ROW tsrow;
|
||||||
TAOS_ROW tsrow;
|
TAOS_ROW urow;
|
||||||
TAOS_ROW urow;
|
int32_t* length; // length for each field for current row
|
||||||
int32_t* length; // length for each field for current row
|
char ** buffer; // Buffer used to put multibytes encoded using unicode (wchar_t)
|
||||||
char ** buffer; // Buffer used to put multibytes encoded using unicode (wchar_t)
|
SColumnIndex* pColumnIndex;
|
||||||
SColumnIndex * pColumnIndex;
|
|
||||||
SArithmeticSupport* pArithSup; // support the arithmetic expression calculation on agg functions
|
SArithmeticSupport* pArithSup; // support the arithmetic expression calculation on agg functions
|
||||||
|
struct SLocalReducer* pLocalReducer;
|
||||||
struct SLocalReducer *pLocalReducer;
|
|
||||||
} SSqlRes;
|
} SSqlRes;
|
||||||
|
|
||||||
typedef struct STscObj {
|
typedef struct STscObj {
|
||||||
|
|
|
@ -789,8 +789,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
|
||||||
|
|
||||||
size_t output = tscNumOfFields(pQueryInfo);
|
size_t output = tscNumOfFields(pQueryInfo);
|
||||||
|
|
||||||
if ((tscIsSecondStageQuery(pQueryInfo) || UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo) ||
|
if (tscIsSecondStageQuery(pQueryInfo)) {
|
||||||
UTIL_TABLE_IS_CHILD_TABLE(pTableMetaInfo))) {
|
|
||||||
pQueryMsg->secondStageOutput = htonl((int32_t) output);
|
pQueryMsg->secondStageOutput = htonl((int32_t) output);
|
||||||
|
|
||||||
SSqlFuncMsg *pSqlFuncExpr1 = (SSqlFuncMsg *)pMsg;
|
SSqlFuncMsg *pSqlFuncExpr1 = (SSqlFuncMsg *)pMsg;
|
||||||
|
@ -2219,7 +2218,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pRes->row = 0;
|
pRes->row = 0;
|
||||||
tscDebug("%p numOfRows:%" PRId64 ", offset:%" PRId64 ", complete:%d", pSql, pRes->numOfRows, pRes->offset, pRes->completed);
|
tscDebug("%p numOfRows:%d, offset:%" PRId64 ", complete:%d", pSql, pRes->numOfRows, pRes->offset, pRes->completed);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR
|
||||||
SSqlRes* pRes1 = &pParentSql->pSubs[i]->res;
|
SSqlRes* pRes1 = &pParentSql->pSubs[i]->res;
|
||||||
|
|
||||||
if (pRes1->row > 0 && pRes1->numOfRows > 0) {
|
if (pRes1->row > 0 && pRes1->numOfRows > 0) {
|
||||||
tscDebug("%p sub:%p index:%d numOfRows:%"PRId64" total:%"PRId64 " (not retrieve)", pParentSql, pParentSql->pSubs[i], i,
|
tscDebug("%p sub:%p index:%d numOfRows:%d total:%"PRId64 " (not retrieve)", pParentSql, pParentSql->pSubs[i], i,
|
||||||
pRes1->numOfRows, pRes1->numOfTotal);
|
pRes1->numOfRows, pRes1->numOfTotal);
|
||||||
assert(pRes1->row < pRes1->numOfRows);
|
assert(pRes1->row < pRes1->numOfRows);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1093,7 +1093,7 @@ static void joinRetrieveFinalResCallback(void* param, TAOS_RES* tres, int numOfR
|
||||||
pRes1->numOfClauseTotal += pRes1->numOfRows;
|
pRes1->numOfClauseTotal += pRes1->numOfRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
tscDebug("%p sub:%p index:%d numOfRows:%"PRId64" total:%"PRId64, pParentSql, pParentSql->pSubs[i], i,
|
tscDebug("%p sub:%p index:%d numOfRows:%d total:%"PRId64, pParentSql, pParentSql->pSubs[i], i,
|
||||||
pRes1->numOfRows, pRes1->numOfTotal);
|
pRes1->numOfRows, pRes1->numOfTotal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2032,7 +2032,7 @@ static void tscRetrieveFromDnodeCallBack(void *param, TAOS_RES *tres, int numOfR
|
||||||
assert(pRes->numOfRows == numOfRows);
|
assert(pRes->numOfRows == numOfRows);
|
||||||
int64_t num = atomic_add_fetch_64(&pState->numOfRetrievedRows, numOfRows);
|
int64_t num = atomic_add_fetch_64(&pState->numOfRetrievedRows, numOfRows);
|
||||||
|
|
||||||
tscDebug("%p sub:%p retrieve numOfRows:%" PRId64 " totalNumOfRows:%" PRIu64 " from ep:%s, orderOfSub:%d", pParentSql, pSql,
|
tscDebug("%p sub:%p retrieve numOfRows:%d totalNumOfRows:%" PRIu64 " from ep:%s, orderOfSub:%d", pParentSql, pSql,
|
||||||
pRes->numOfRows, pState->numOfRetrievedRows, pSql->epSet.fqdn[pSql->epSet.inUse], idx);
|
pRes->numOfRows, pState->numOfRetrievedRows, pSql->epSet.fqdn[pSql->epSet.inUse], idx);
|
||||||
|
|
||||||
if (num > tsMaxNumOfOrderedResults && tscIsProjectionQueryOnSTable(pQueryInfo, 0)) {
|
if (num > tsMaxNumOfOrderedResults && tscIsProjectionQueryOnSTable(pQueryInfo, 0)) {
|
||||||
|
@ -2171,7 +2171,7 @@ static void multiVnodeInsertFinalize(void* param, TAOS_RES* tres, int numOfRows)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tscDebug("%p Async insertion completed, total inserted:%" PRId64, pParentObj, pParentObj->res.numOfRows);
|
tscDebug("%p Async insertion completed, total inserted:%d", pParentObj, pParentObj->res.numOfRows);
|
||||||
|
|
||||||
// restore user defined fp
|
// restore user defined fp
|
||||||
pParentObj->fp = pParentObj->fetchFp;
|
pParentObj->fp = pParentObj->fetchFp;
|
||||||
|
|
|
@ -220,11 +220,6 @@ bool tscIsPointInterpQuery(SQueryInfo* pQueryInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tscIsSecondStageQuery(SQueryInfo* pQueryInfo) {
|
bool tscIsSecondStageQuery(SQueryInfo* pQueryInfo) {
|
||||||
STableMetaInfo* pTableMetaInfo = pQueryInfo->pTableMetaInfo[0];
|
|
||||||
if (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tscIsProjectionQuery(pQueryInfo)) {
|
if (tscIsProjectionQuery(pQueryInfo)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -853,9 +853,9 @@ static int32_t getNextQualifiedWindow(SQueryRuntimeEnv *pRuntimeEnv, STimeWindow
|
||||||
int32_t factor = GET_FORWARD_DIRECTION_FACTOR(pQuery->order.order);
|
int32_t factor = GET_FORWARD_DIRECTION_FACTOR(pQuery->order.order);
|
||||||
startPos = prevPosition + factor;
|
startPos = prevPosition + factor;
|
||||||
} else {
|
} else {
|
||||||
if (startKey < pDataBlockInfo->window.skey && QUERY_IS_ASC_QUERY(pQuery)) {
|
if (startKey <= pDataBlockInfo->window.skey && QUERY_IS_ASC_QUERY(pQuery)) {
|
||||||
startPos = 0;
|
startPos = 0;
|
||||||
} else if (startKey > pDataBlockInfo->window.ekey && !QUERY_IS_ASC_QUERY(pQuery)) {
|
} else if (startKey >= pDataBlockInfo->window.ekey && !QUERY_IS_ASC_QUERY(pQuery)) {
|
||||||
startPos = pDataBlockInfo->rows - 1;
|
startPos = pDataBlockInfo->rows - 1;
|
||||||
} else {
|
} else {
|
||||||
startPos = searchFn((char *)primaryKeys, pDataBlockInfo->rows, startKey, pQuery->order.order);
|
startPos = searchFn((char *)primaryKeys, pDataBlockInfo->rows, startKey, pQuery->order.order);
|
||||||
|
|
Loading…
Reference in New Issue