提交 37b2ae70 编写于 作者: G Ganlin Zhao

[TD-11216]<feature>: Time window related keywords

上级 c549b9e1
......@@ -3823,29 +3823,14 @@ int32_t doGetColumnIndexByName(SStrToken* pToken, SQueryInfo* pQueryInfo, SColum
return TSDB_CODE_TSC_INVALID_OPERATION;
}
int16_t tsWinColumnIndex;
if (isTablenameToken(pToken)) {
pIndex->columnIndex = TSDB_TBNAME_COLUMN_INDEX;
} else if (strlen(DEFAULT_PRIMARY_TIMESTAMP_COL_NAME) == pToken->n &&
strncasecmp(pToken->z, DEFAULT_PRIMARY_TIMESTAMP_COL_NAME, pToken->n) == 0) {
pIndex->columnIndex = PRIMARYKEY_TIMESTAMP_COL_INDEX; // just make runtime happy, need fix java test case InsertSpecialCharacterJniTest
} else if (isTimeWindowToken(pToken, &pIndex->columnIndex)) {
switch (pIndex->columnIndex) {
case TSDB_TSWIN_START_COLUMN_INDEX: {
pQueryInfo->interval.winFlag |= TSDB_TSWIN_START_FLAG;
break;
}
case TSDB_TSWIN_STOP_COLUMN_INDEX: {
pQueryInfo->interval.winFlag |= TSDB_TSWIN_STOP_FLAG;
break;
}
case TSDB_TSWIN_DURATION_COLUMN_INDEX: {
pQueryInfo->interval.winFlag |= TSDB_TSWIN_DURATION_FLAG;
break;
}
default: {
break;
}
}
} else if (isTimeWindowToken(pToken, &tsWinColumnIndex)) {
pIndex->columnIndex = tsWinColumnIndex;
} else {
// not specify the table name, try to locate the table index by column name
if (pIndex->tableIndex == COLUMN_INDEX_INITIAL_VAL) {
......
......@@ -951,7 +951,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pQueryMsg->window.ekey = htobe64(query.window.ekey);
pQueryMsg->range.skey = htobe64(query.range.skey);
pQueryMsg->range.ekey = htobe64(query.range.ekey);
pQueryMsg->order = htons(query.order.order);
pQueryMsg->orderColId = htons(query.order.orderColId);
pQueryMsg->fillType = htons(query.fillType);
......@@ -965,7 +965,6 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pQueryMsg->interval.intervalUnit = query.interval.intervalUnit;
pQueryMsg->interval.slidingUnit = query.interval.slidingUnit;
pQueryMsg->interval.offsetUnit = query.interval.offsetUnit;
pQueryMsg->interval.winFlag = query.interval.winFlag;
pQueryMsg->stableQuery = query.stableQuery;
pQueryMsg->topBotQuery = query.topBotQuery;
......@@ -991,7 +990,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
pQueryMsg->numOfGroupCols = htons(pQueryInfo->groupbyExpr.numOfGroupCols);
pQueryMsg->queryType = htonl(pQueryInfo->type);
pQueryMsg->prevResultLen = htonl(pQueryInfo->bufLen);
// set column list ids
size_t numOfCols = taosArrayGetSize(pQueryInfo->colList);
char *pMsg = (char *)(pQueryMsg->tableCols) + numOfCols * sizeof(SColumnInfo);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册