Github user dongjoon-hyun commented on the pull request:
https://github.com/apache/tajo/pull/543#issuecomment-94321615
Oh. Thank you, @jihoonson .Now, I understand more about your concern and
what causes disagreement.
First, this issue is related ORDER BY SQL name resolution rules rather than
SQL name resolution. The scope is totally different. I think we need to focus
what is the meaning of ORDER BY clause. In that sense, please note that *"it
can optionally be sorted"*. ORDER BY is defined on the SELECT clause. If you
ask 'Why this rule focuses on only order-by clause?', the reason is ORDER BY
clause is different from the others.
Second, let me answer your remaining concerns.
* Why does the same rule can be applied to group-by clauses or any other
clauses? --> We can not. As you know, the other clause affect SELECT clause;
e.g. GROUP BY clause will generate aggregate functions on SELECT clause.
* What happens if the select and order-by clauses involve two or more
columns? --> Each column among them should be need to be resolved
independently. In case of multiple matching, we should print out 'Ambiguous
Column Name Error' again. I think it is logical. If you agree with this, I will
add more codes and testcases for this.
Thank you for you kind guide, again, @jihoonson .
---
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 [email protected] or file a JIRA ticket
with INFRA.
---