-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Group by an empty key with an aggregate throws 'must be reducible node' #11905
Comments
Technically, this is a regression. Versions |
@divega @ajcvickers - Do we want to block this for 2.1 or convert to group by constant? |
@AlekseyMartynov what is the scenario exactly for this? I am guessing that a DevExpress component uses this expression, but please confirm. |
Resolves #11905 Issue: GroupBy(g => new {}) converts to GroupBy(Constant) because of key not being correlated with range variable. We translate GroupBy constant to server but in this case, the constant is of anon type which cannot be put in SQL tree hence translation pipeline failed. Fix is to inject `1` as constant whenever we see GroupBy constant of a type which cannot be represented in SQL
@AlekseyMartynov - To add a bit more, with the fix, we will inject a custom Key of |
Resolves #11905 Issue: GroupBy(g => new {}) converts to GroupBy(Constant) because of key not being correlated with range variable. We translate GroupBy constant to server but in this case, the constant is of anon type which cannot be put in SQL tree hence translation pipeline failed. Fix is to inject `1` as constant whenever we see GroupBy constant of a type which cannot be represented in SQL. We also don't save it in mapping so that if key is projected out, we construct it again on client side.
Correct. I mentioned this case in #2341 (comment). @smitpatel: |
@AlekseyMartynov - With the fix going in, we implemented that, if you do |
Version:
2.1.0-preview2-final
Query:
Exception:
EF6 seems to handle this query by rewriting to
.GroupBy(obj => 1)
:The text was updated successfully, but these errors were encountered: