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: GroupBy aggregate failure when key property is also part of Elementselector #11999

Closed
smitpatel opened this issue May 14, 2018 · 2 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. regression type-bug
Milestone

Comments

@smitpatel
Copy link
Contributor

        [ConditionalFact]
        public virtual void GroupBy_Key_element_clash()
        {
            AssertQuery<Order>(
                os => os.GroupBy(o => o.OrderID, o => new { o.OrderID, o.OrderDate })
                        .Select(g => new
                        {
                            g.Key,
                            Avg = g.Average(e => e.OrderID),
                            Max = g.Max(o => o.OrderDate)
                        }));
        }
@smitpatel smitpatel self-assigned this May 14, 2018
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label May 14, 2018
smitpatel added a commit that referenced this issue May 14, 2018
smitpatel added a commit that referenced this issue May 15, 2018
@smitpatel smitpatel reopened this May 15, 2018
@ajcvickers ajcvickers added this to the 2.1.1 milestone May 16, 2018
@ajcvickers
Copy link
Contributor

@smitpatel @anpete @maumar Let's discuss this one again in triage tomorrow with specific focus on risk for patching. /cc @divega

@ajcvickers ajcvickers removed this from the 2.1.1 milestone May 22, 2018
@ajcvickers
Copy link
Contributor

Re-triage: We are not going to patch this because there is some risk in the fix and there is a good workaround: remove the o => new { o.OrderID, o.OrderDate } projection, since with translation to the server it will result in the same query being generated and the same data being returned.

[ConditionalFact]
        public virtual void GroupBy_Key_element_clash()
        {
            AssertQuery<Order>(
                os => os.GroupBy(o => o.OrderID)
                        .Select(g => new
                        {
                            g.Key,
                            Avg = g.Average(e => e.OrderID),
                            Max = g.Max(o => o.OrderDate)
                        }));
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. regression type-bug
Projects
None yet
Development

No branches or pull requests

2 participants