fix:set timestamp precision
This commit is contained in:
parent
ba83826ce1
commit
8a23f0ce3b
|
@ -2003,7 +2003,7 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
|
||||||
switch (pColInfoData->info.type) {
|
switch (pColInfoData->info.type) {
|
||||||
case TSDB_DATA_TYPE_TIMESTAMP:
|
case TSDB_DATA_TYPE_TIMESTAMP:
|
||||||
memset(pBuf, 0, sizeof(pBuf));
|
memset(pBuf, 0, sizeof(pBuf));
|
||||||
formatTimestamp(pBuf, *(uint64_t*)var, TSDB_TIME_PRECISION_MILLI);
|
formatTimestamp(pBuf, *(uint64_t*)var, pColInfoData->info.precision);
|
||||||
len += snprintf(dumpBuf + len, size - len, " %25s |", pBuf);
|
len += snprintf(dumpBuf + len, size - len, " %25s |", pBuf);
|
||||||
if (len >= size - 1) return dumpBuf;
|
if (len >= size - 1) return dumpBuf;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1211,7 +1211,8 @@ static EDealRes translateValueImpl(STranslateContext* pCxt, SValueNode* pVal, SD
|
||||||
} else {
|
} else {
|
||||||
res = translateNormalValue(pCxt, pVal, targetDt, strict);
|
res = translateNormalValue(pCxt, pVal, targetDt, strict);
|
||||||
}
|
}
|
||||||
pVal->node.resType = targetDt;
|
pVal->node.resType.type = targetDt.type;
|
||||||
|
pVal->node.resType.bytes = targetDt.bytes;
|
||||||
pVal->node.resType.scale = pVal->unit;
|
pVal->node.resType.scale = pVal->unit;
|
||||||
pVal->translate = true;
|
pVal->translate = true;
|
||||||
if (!strict && TSDB_DATA_TYPE_UBIGINT == pVal->node.resType.type && pVal->datum.u <= INT64_MAX) {
|
if (!strict && TSDB_DATA_TYPE_UBIGINT == pVal->node.resType.type && pVal->datum.u <= INT64_MAX) {
|
||||||
|
|
|
@ -915,6 +915,7 @@ int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_
|
||||||
|
|
||||||
SDataType t = {.type = type};
|
SDataType t = {.type = type};
|
||||||
t.bytes = IS_VAR_DATA_TYPE(t.type)? input->columnData->info.bytes:tDataTypes[type].bytes;
|
t.bytes = IS_VAR_DATA_TYPE(t.type)? input->columnData->info.bytes:tDataTypes[type].bytes;
|
||||||
|
t.precision = input->columnData->info.precision;
|
||||||
|
|
||||||
int32_t code = sclCreateColumnInfoData(&t, input->numOfRows, output);
|
int32_t code = sclCreateColumnInfoData(&t, input->numOfRows, output);
|
||||||
if (code != TSDB_CODE_SUCCESS) {
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
|
Loading…
Reference in New Issue