paul-rogers commented on PR #13173: URL: https://github.com/apache/druid/pull/13173#issuecomment-1272694039
@somu-imply, thanks much for the detailed explanation! It strikes me that the problem is in how we validate queries. We really should not have to do an artificial `EXPLAIN` to get the right results. The way it _should_ work is: * Calcite validates the query. This will check all types, etc. * Convert the query into a logical plan (the `Rel` nodes) * Resolve the type (i.e. row schema) for each `Rel` * Convert the `Rel` nodes into a native query. As a result, every step should have a correct row type (schema). If not, all heck breaks loose same as if we randomly changed some numbers in an algorithm and expected correct answers. If we have to jimmy the code to get the right answers, it means something is wrong somewhere in that list above. Unfortunately, Calcite is horribly complex. (Not Calcite's fault, _all_ SQL planners are horribly complex.) So, it is a real PITA to find where things go wrong. As a result, we may have to do a hack just to keep things moving. But, the need for the hack suggests there are deeper issues, and we should track those down at some point, else they'll just pop up again elsewhere. -- 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]
