Skip to content
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

Query: Translate GroupBy new {} to GroupBy constant 1 #11911

Merged
merged 1 commit into from
May 4, 2018

Conversation

smitpatel
Copy link
Contributor

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

@ajcvickers
Copy link
Contributor

Approved for merge into release/2.1

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.
@smitpatel
Copy link
Contributor Author

smitpatel commented May 4, 2018

@dotnet-bot test windows release x64 build

1 similar comment
@smitpatel
Copy link
Contributor Author

@dotnet-bot test windows release x64 build

@smitpatel smitpatel merged commit d96bad0 into release/2.1 May 4, 2018
@smitpatel smitpatel deleted the smit/bug2 branch May 4, 2018 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants