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

In version 3.3.4.8 of TDengine, The combination of the time series functions DISTINCT and ORDER BY triggers an internal error in the planner. #29263

Open
LingweiKuang opened this issue Dec 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@LingweiKuang
Copy link

Bug Description

The abstract expression sequence is: SELECT DISTINCT CSUM(column), time FROM table ORDER BY time;

To Reproduce

Assume that we execute the following statement under a database named testdb.

DROP TABLE IF EXISTS t1;
CREATE TABLE t1(time TIMESTAMP, c1 INT);
INSERT INTO t1(time, c1) VALUES (1641024000000, 1), (1641024005000, 2);

# query 1
SELECT DISTINCT CSUM(c1), time FROM t1 ORDER BY time;
SELECT DISTINCT CSUM(c1), time AS ref FROM t1 ORDER BY ref;

# query 2
SELECT DISTINCT CSUM(c1), time FROM t1;

Expected Behavior

Expected result set for Query 1: 1 and 3

Expected result set for Query 2: 1 and 3

Actual behaviour

Query 1 returned result set: DB error: Planner internal error

Query 2 returned result set: 1 and 3

Environment

  • OS:Ubuntu Server 22.04 LTS 64bit
  • TDengine Version:3.3.4.8

Additional Context

Hello, TDengine team. When I combine time series-specific functions with DISTINCT and sort the data by the time field, the TDengine planner returns an internal error. This may be a potential crash error in the planner. Not only the CSUM function triggers this error, but other time series-specific functions also cause this error.

@LingweiKuang LingweiKuang added the bug Something isn't working label Dec 21, 2024
@LingweiKuang
Copy link
Author

In version 3 3 4 8 of TDengine, The combination of the time series functions DISTINCT and ORDER BY triggers an internal error in the planner

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

1 participant