Github user yhuai commented on the pull request:

    https://github.com/apache/spark/pull/6169#issuecomment-102263396
  
    I feel it is hard to fix it. Since we can end up having a chain of `Window` 
operators. Probably the best chance is to add those missing columns to the 
project list before we extract window expressions and create `Window` 
operators. However, I think it requires lots of changes. I guess for now, it 
will be good to provide an nice error message and ask the user to add missing 
order by expressions back to the select clause (if users really do not want the 
order by expressions, put window functions in a sub query and do not project 
these expressions in the outer query block). In order to generate the nice 
error message, I think we can just detect the pattern of 
`sort->project->window` and see if we have missing columns in the sort operator.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to