Open
Description
如果数据库的时间戳精度设置为微秒或者纳秒,在java中通过tmq获取订阅的数据时,时间戳不能被正确转换为正确的时间格式,都会按照毫秒的精度转换,所以时间段年份会变的特别大。经过跟踪发现,在com.taosdata.jdb.TSDBJNIConnector 中的
/**
* Get Result Time Precision.
*
* @return 0: ms, 1: us, 2: ns
*/
public int getResultTimePrecision(long sqlObj) {
return this.getResultTimePrecisionImp(this.taos, sqlObj);
}
private native int getResultTimePrecisionImp(long connection, long result);
这个方法获得的精度总是0,也就是毫秒。
Metadata
Metadata
Assignees
Labels
No labels