You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I tried to execute some SQL using cnosdb.When I execute the following sql, the execution fails, I don't find the syntax error, the error message is sum(...) ... Not a "field name". Here's the sql I executed: select driver, date_trunc('day',time) as c_date, time, load_capacity, fuel_capacity, sum(case when elevation<50 then elevation else 0 end) over (partition by driver) /sum(elevation) over (partition by driver)/2 from readings where driver in ('Seth','Albert') and time>='2017-01-01T00:00:00' and time<='2017-01-02T00:00:00';
version:4e7cfef
This is the error message about the sql: 422 Unprocessable Entity, details: {\"error_code\":\"010001\",\"error_message\":\"Datafusion: type_coercion\\ncaused by\\nInternal error: Optimizer rule 'type_coercion' failed due to unexpected error: Schema error: No field named 'SUM(CASE WHEN readings.elevation < Int64(50) THEN readings.elevation ELSE Int64(0) END) PARTITION BY [readings.driver] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING'. Valid fields are 'readings'.'time', 'readings'.'driver', 'readings'.'elevation', 'readings'.'load_capacity', 'readings'.'fuel_capacity', 'SUM(readings.elevation) PARTITION BY [readings.driver] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING'.. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker\"}
To Reproduce
Expected behavior
The above SQL should execute normally
Additional context
The text was updated successfully, but these errors were encountered:
It seems that during the expression conversion process, the expression changes and there is no alias, so the projection cannot find the corresponding column name
Describe the bug
I tried to execute some SQL using cnosdb.When I execute the following sql, the execution fails, I don't find the syntax error, the error message is sum(...) ... Not a "field name". Here's the sql I executed:
select driver, date_trunc('day',time) as c_date, time, load_capacity, fuel_capacity, sum(case when elevation<50 then elevation else 0 end) over (partition by driver) /sum(elevation) over (partition by driver)/2 from readings where driver in ('Seth','Albert') and time>='2017-01-01T00:00:00' and time<='2017-01-02T00:00:00';
version:4e7cfef
This is the error message about the sql:
422 Unprocessable Entity, details: {\"error_code\":\"010001\",\"error_message\":\"Datafusion: type_coercion\\ncaused by\\nInternal error: Optimizer rule 'type_coercion' failed due to unexpected error: Schema error: No field named 'SUM(CASE WHEN readings.elevation < Int64(50) THEN readings.elevation ELSE Int64(0) END) PARTITION BY [readings.driver] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING'. Valid fields are 'readings'.'time', 'readings'.'driver', 'readings'.'elevation', 'readings'.'load_capacity', 'readings'.'fuel_capacity', 'SUM(readings.elevation) PARTITION BY [readings.driver] ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING'.. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker\"}
To Reproduce
Expected behavior
The above SQL should execute normally
Additional context
The text was updated successfully, but these errors were encountered: