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

Aggregated model query incompatible with MySql 5.7.5 #204

Open
tuliren opened this issue Dec 12, 2017 · 1 comment
Open

Aggregated model query incompatible with MySql 5.7.5 #204

tuliren opened this issue Dec 12, 2017 · 1 comment

Comments

@tuliren
Copy link
Contributor

tuliren commented Dec 12, 2017

ModelQuery#getSelectClause adds the id column to its select clause (code):

sqlClause.append("id, ");

However, when querying with a group by clause, this is incompatible with the new ONLY_FULL_GROUP_BY mode introduced in MySql 5.7.5 (reference):

Reject queries for which the select list, HAVING condition, or ORDER BY list refer to nonaggregated columns that are neither named in the GROUP BY clause nor are functionally dependent on (uniquely determined by) GROUP BY columns.

As of MySQL 5.7.5, the default SQL mode includes ONLY_FULL_GROUP_BY. (Before 5.7.5, MySQL does not detect functional dependency and ONLY_FULL_GROUP_BY is not enabled by default.

@tuliren
Copy link
Contributor Author

tuliren commented Dec 12, 2017

I propose to add a @Deprecation annotation to the selectAgg method. Users can use GenericQuery instead.

tuliren added a commit to tuliren/jack that referenced this issue Dec 12, 2017
This test is ordered by users.id, but it is not an aggregrated column, which is not compatible with the new only_full_group_by mode introduced into mysql 5.7.5.

Relates to LiveRamp#204
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

No branches or pull requests

1 participant