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

FILL 子句,线性插值时希望支持起始和结束时间点设置默认值 #29158

Open
endlesslove123 opened this issue Dec 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@endlesslove123
Copy link

目前使用的tdengine版本为3.3.3.0
当使用FILL子句FILL(LINEAR),进行线性插值时,如果起始时间点或者结束时间点没有值时,在第一个时间点到第一个有值的时间点之间的值都会被设置为null,比如查询t001表"2024-11-01 00:00:00"到"2024-11-02 00:00:00"的数据时间按照1分钟计算INTERVAL(1m),具体语句如
SELECT _WSTART AS ts, sum(v) AS monitorValue FROM t001 WHERE ts >= '2024-11-01 00:00:00' AND ts <= '2024-11-02 00:00:00' interval(1m) FILL(LINEAR);

此时如果2024-11-01 00:00:00这个时间点没有值的话,2024-11-01 00:02:00为第一个有值的时间点,则返回的数据就是

  1. 2024-11-01 00:00:00 NULL
  2. 2024-11-01 00:01:00 NULL

实际中是想2024-11-01 00:00:00这个点按0设置成默认值,后续进行线性插值,但是现在无法满足要求,所以建议 FILL(LINEAR)能增加参数或者其他方式,能够实现设置起始时间点和结束时间点如果没有值的情况下可以设置默认值的功能,以达到整个时间段都能支持线性插值的需求,万分感谢

@endlesslove123 endlesslove123 added the enhancement New feature or request label Dec 16, 2024
@endlesslove123 endlesslove123 changed the title FILL 子句,线性插值时希望支持起始时间点设置默认值 FILL 子句,线性插值时希望支持起始和结束时间点设置默认值 Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant