提交 89bd2f47 编写于 作者: G Ganlin Zhao

"[TD-11220]<feature>(query): time related functions"

上级 507717d4
......@@ -2547,6 +2547,14 @@ void vectorTimeFunc(int16_t functionId, tExprOperandInfo *pInputs, int32_t numIn
} else if (pInputs[j].type == TSDB_DATA_TYPE_BIGINT ||
pInputs[j].type == TSDB_DATA_TYPE_TIMESTAMP) { /* unix timestamp or ts column*/
GET_TYPED_DATA(timeVal[j], int64_t, pInputs[j].type, inputData[j]);
if (pInputs[j].type == TSDB_DATA_TYPE_TIMESTAMP) {
int64_t factor = (timePrec == TSDB_TIME_PRECISION_MILLI) ? 1000 :
(timePrec == TSDB_TIME_PRECISION_MICRO ? 1000000 : 1000000000);
int64_t timeValSec = timeVal[j] / factor;
if (timeValSec < 1000000000) {
timeVal[j] = timeValSec;
}
}
char buf[20] = {0};
NUM_TO_STRING(TSDB_DATA_TYPE_BIGINT, &timeVal[j], sizeof(buf), buf);
int32_t tsDigits = strlen(buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册