Skip to content

Query: Skip constants in GROUP BY - #17114

Merged
smitpatel merged 3 commits into
dotnet:release/3.0from
kosinsky:features/ODataStyleGroupBy
Aug 15, 2019
Merged

smitpatel merged 3 commits into
dotnet:release/3.0from
kosinsky:features/ODataStyleGroupBy

Conversation

@kosinsky

@kosinsky kosinsky commented Aug 12, 2019 •

Copy link
Copy Markdown
Contributor
  • The code builds and tests pass (verified by our automated build checks)
  • Commit messages follow this format

If Linq expression uses constants in GroupBy skip these constants in SQL GROUP BY to avoid "Each GROUP BY expression must contain at least one column that is not an outer reference" SQL exception.

Fixes #14152

@kosinsky
kosinsky marked this pull request as ready for review August 13, 2019 00:05
@smitpatel

Copy link
Copy Markdown
Contributor

This is not the correct way to solve this.

@kosinsky

kosinsky commented Aug 13, 2019 •

Copy link
Copy Markdown
Contributor Author

OK, I did more diggin and found that I could achieve the same goal by not adding constant in SelectExpression.GroupBy collection in first place. Am I on right track or I should go even higher upstream?

I've updated PR to show that approach.

@smitpatel
smitpatel merged commit f13ae3b into dotnet:release/3.0 Aug 15, 2019
@smitpatel

Copy link
Copy Markdown
Contributor

@kosinsky - Thank you for contribution. The 2nd approach seemed more appropriate.

@kosinsky
kosinsky deleted the features/ODataStyleGroupBy branch August 15, 2019 21:02
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.

Support for GroupBy key with nested structure for ODATA

2 participants