Skip to content

3.3.4.3版本Window Join的WINDOW_OFFSET函数时间单位无效 #30691

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

Open
JellyChangan opened this issue Apr 8, 2025 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@JellyChangan
Copy link

Bug Description
3.3.4.3版本Window Join的WINDOW_OFFSET函数时间单位不一致。
我创建了一个时间精度为微秒的数据库,使用微秒时间戳插入数据。在使用Window Join的WINDOW_OFFSET函数时,设置WINDOW_OFFSET的时间创建为上下5微秒不生效,但是设置为上下5毫秒就可以,这难道不是错误的吗?
我看官方文档里面说支持最小时间精度为数据库的时间精度
To Reproduce
Steps to reproduce the behavior:
复现流程
创建数据库和超级表
CREATE DATABASE iot_db_2 KEEP 30d PRECISION 'us'; CREATE STABLE iot_db_2.iot_st (tsTIMESTAMP,idfVARCHAR(30),dpv VARCHAR(120)) TAGS (pidVARCHAR(20),dev_idVARCHAR(50));
插入数据
`INSERT INTO iot_db_2._vdevo173640127476293 USING iot_db_2.iot_st TAGS ('edvvtha2xnjibotq', 'vdevo173640127476293')
VALUES
(1744013161000980, 'parameter_group_1_1', '1')
(1744013161000981, 'parameter_group_1_2', '2')
(1744013161000982, 'parameter_group_1_3', '3')
(1744013161000983, 'parameter_group_1_4', '4')
(1744013161000984, 'parameter_group_1_5', '5')
(1744013161000985, 'parameter_group_1_6', '6')
(1744013161000986, 'parameter_group_1_7', '7')
(1744013161000987, 'parameter_group_1_8', '8')
(1744013161000988, 'parameter_group_1_9', '9')
(1744013161000989, 'parameter_group_1_10', '10')
(1744013161000990, 'parameter_group_1_11', '11')
(1744013161000991, 'parameter_group_1_12', '12')
(1744013161000992, 'parameter_group_1_13', '13')
(1744013161000993, 'parameter_group_1_14', '14')
(1744013161000994, 'parameter_group_1_15', '15')
(1744013161000995, 'parameter_group_1_16', '16')
(1744013161000996, 'parameter_group_1_17', '17')
(1744013161000997, 'parameter_group_1_18', '18')
(1744013161000998, 'parameter_group_1_19', '19')
(1744013161000999, 'parameter_group_1_20', '20');

INSERT INTO iot_db_2._vdevo173640127476293 USING iot_db_2.iot_st TAGS ('edvvtha2xnjibotq', 'vdevo173640127476293')
VALUES
(1744077028000980, 'parameter_group_1_1', '21')
(1744077028000981, 'parameter_group_1_2', '22')
(1744077028000982, 'parameter_group_1_3', '23')
(1744077028000983, 'parameter_group_1_4', '24')
(1744077028000984, 'parameter_group_1_5', '25')
(1744077028000985, 'parameter_group_1_6', '26')
(1744077028000986, 'parameter_group_1_7', '27')
(1744077028000987, 'parameter_group_1_8', '28')
(1744077028000988, 'parameter_group_1_9', '29')
(1744077028000989, 'parameter_group_1_10', '30')
(1744077028000990, 'parameter_group_1_11', '31')
(1744077028000991, 'parameter_group_1_12', '32')
(1744077028000992, 'parameter_group_1_13', '33')
(1744077028000993, 'parameter_group_1_14', '34')
(1744077028000994, 'parameter_group_1_15', '35')
(1744077028000995, 'parameter_group_1_16', '36')
(1744077028000996, 'parameter_group_1_17', '37')
(1744077028000997, 'parameter_group_1_18', '38')
(1744077028000998, 'parameter_group_1_19', '39')
(1744077028000999, 'parameter_group_1_20', '40');`

微秒单位查询,得不到正确效果
select a.* from _vdevo173640127476293 a left window join _vdevo173640127476293 b window_offset(-5u, 5u) where b.idf = 'parameter_group_1_12' and b.dpv = '12';

毫秒单位查询,可以得到正确效果
select a.* from _vdevo173640127476293 a left window join _vdevo173640127476293 b window_offset(-5a, 5a) where b.idf = 'parameter_group_1_12' and b.dpv = '12';

Expected Behavior
为什么用微秒单位进行查询得不到正确效果?
正确效果是先找到_vdevo173640127476293 表中符合where条件的数据,并且把符合条件的数据ts前后x微秒内的数据查询出来

Screenshots
运行截图
Image
Image
Image

Environment (please complete the following information):

  • TDengine Version 3.3.4.3
  • docker社区版 24.0.6 容器运行

Additional Context
Add any other context about the problem here.

@JellyChangan JellyChangan added the bug Something isn't working label Apr 8, 2025
@yu285
Copy link
Contributor

yu285 commented Apr 14, 2025

我们看下

@yu285 yu285 self-assigned this Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants