Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bdyaods opened this issue Feb 18, 2024 · 2 comments
Open

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

bdyaods opened this issue Feb 18, 2024 · 2 comments

Comments

@bdyaods
Copy link

bdyaods commented Feb 18, 2024

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

@bdyaods
Copy link
Author

bdyaods commented Feb 18, 2024

只在数据订阅中有这个问题,使用连接器查询数据时的时间戳没有这个问题

@sheyanjie-qq
Copy link
Contributor

请补充下 TDengine 版本信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants