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

Unexpected results in intermediate table when downsampling two tables' data on a monthly basis through stream processing #25303

Open
nieyuan1980 opened this issue Apr 9, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@nieyuan1980
Copy link

一、对两个表具按月取最大值进行降采样

select _wstart recode_time, meter_code, max(dqljlcc) max_value
from water_meters1
where meter_code in ('METXJJSZXNSB1', 'METXJNGWDXFSX')
partition by meter_code, location, working_on, is_calc interval (1n)
order by meter_code, recode_time;

2

二、使用流式计算将结果写入中间表

create stream water_meter_ns trigger at_once fill_history 1
into water_meter_n
    tags(meter_code varchar(32), location varchar(512), working_on varchar(32), is_calc varchar(8))
    subtable(cast(concat('n_', lower(meter_code)) as varchar(32))) as
select _wstart recode_time, max (dqljlcc) max_value
from water_meters1
where meter_code in ('METXJJSZXNSB1', 'METXJNGWDXFSX')
partition by meter_code, location, working_on, is_calc interval (1n);

三、查询中间表

select * from order by meter_code, recode_time;

3

  • OS: [CentOS 7.0]
  • CPU: [CentOS 7.0],
  • Memory: [2G]
  • Disk Space: [40G]
  • TDengine Version [3.2.0.0]
@nieyuan1980 nieyuan1980 added the bug Something isn't working label Apr 9, 2024
@danielclow danielclow changed the title 使用流式计算将两个表具数据进行月度降采样,写入中间表后的结果不正确 Unexpected results in intermediate table when downsampling two tables' data on a monthly basis through stream processing Apr 26, 2024
@yu285 yu285 self-assigned this May 10, 2024
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