DockerLive opened a new issue #10140:
URL: https://github.com/apache/druid/issues/10140
### Affected Version
Druid version : 0.18.0
### Description
- Druid SQL queries using the Avatica JDBC driver.
- The Order BY field must use the field alias
- The Group by field must not use field aliases
- Otherwise the SQL will parse the exception
- The same SQL that I use to execute queries through the UI that druid comes
with is normal
- Replace the Order BY field with an alias;The Group by field is replaced
with the field name, and the SQL executes normally
The scenario is as follows:
SQL:
select
TIME_FORMAT(FLOOR(__time to day), 'yyyyMMdd') as time_ ,
cast(sum(cnt) as VARCHAR) as measureValue
from tab_test
where __time >= '2019-05-31' and __time < '2020-08-28'
and biz_date between '20200601' and '20200627'
and project = 'com'
and event_key = 'app_boot_cold'
group by
TIME_FORMAT(FLOOR(__time to day), 'yyyyMMdd')
order by
TIME_FORMAT(FLOOR(__time to day), 'yyyyMMdd')
Exception:
org.apache.calcite.runtime.CalciteContextException: From line 21, column 35
to line 21, column 40: Column '__time' not found in any table
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]