somu-imply commented on PR #12418: URL: https://github.com/apache/druid/pull/12418#issuecomment-1094470313
@abhishekagarwal87 thanks for your comments. The scan query allows order by only on the __time column and the column name also needs to be `__time` as in https://github.com/apache/druid/blob/8edea5a82dfdb34c3177c0efd7a79bae54751ab8/sql/src/main/java/org/apache/druid/sql/calcite/rel/DruidQuery.java#L1205. Your suggestion works great. It is unfortunate that the planner reaches a scan query (may be due to the exploratory nature) where it should have been contained to an outer sort and an inner group by query. The difference between the two approaches are ignoring a faulty plan vs correcting a faulty plan (as the faulty plan uses the alias name instead of __time). I am not that familiar with calcite, can we guarantee that the faulty plan if corrected will never generate a plan with a better cost ? -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
