Skip to content

tmq订阅数据时时间戳精度问题 #145

Open
@bdyaods

Description

@bdyaods

如果数据库的时间戳精度设置为微秒或者纳秒,在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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions