Github user jinfengni commented on the issue: https://github.com/apache/drill/pull/549 I feel it might be better to work on this issue after Drill rebases Calcite. I debugged a bit in SqlValidator, and seem that the code in Drill's forked Calcite is different from what Calcite master has. It's possible that some of patches (star column) in Drill's forked Calcite changes the behavior, and hence run into problem with the subquery cases. Since star column logic has been merged to Calcite master, it's better to try with this patch after rebasing on top of Calcite master, in stead of coming up with a temporary solution with restrictions.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---