{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8625","repository_url":"https://api.github.com/repos/orientechnologies/orientdb","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8625/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8625/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8625/events","html_url":"https://github.com/orientechnologies/orientdb/issues/8625","id":374342305,"node_id":"MDU6SXNzdWUzNzQzNDIzMDU=","number":8625,"title":"Group by not working when columns not returned directly in select","user":{"login":"josalmi","id":5629299,"node_id":"MDQ6VXNlcjU2MjkyOTk=","avatar_url":"https://avatars3.githubusercontent.com/u/5629299?v=4","gravatar_id":"","url":"https://api.github.com/users/josalmi","html_url":"https://github.com/josalmi","followers_url":"https://api.github.com/users/josalmi/followers","following_url":"https://api.github.com/users/josalmi/following{/other_user}","gists_url":"https://api.github.com/users/josalmi/gists{/gist_id}","starred_url":"https://api.github.com/users/josalmi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josalmi/subscriptions","organizations_url":"https://api.github.com/users/josalmi/orgs","repos_url":"https://api.github.com/users/josalmi/repos","events_url":"https://api.github.com/users/josalmi/events{/privacy}","received_events_url":"https://api.github.com/users/josalmi/received_events","type":"User","site_admin":false},"labels":[{"id":197557840,"node_id":"MDU6TGFiZWwxOTc1NTc4NDA=","url":"https://api.github.com/repos/orientechnologies/orientdb/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"luigidellaquila","id":459289,"node_id":"MDQ6VXNlcjQ1OTI4OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/459289?v=4","gravatar_id":"","url":"https://api.github.com/users/luigidellaquila","html_url":"https://github.com/luigidellaquila","followers_url":"https://api.github.com/users/luigidellaquila/followers","following_url":"https://api.github.com/users/luigidellaquila/following{/other_user}","gists_url":"https://api.github.com/users/luigidellaquila/gists{/gist_id}","starred_url":"https://api.github.com/users/luigidellaquila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigidellaquila/subscriptions","organizations_url":"https://api.github.com/users/luigidellaquila/orgs","repos_url":"https://api.github.com/users/luigidellaquila/repos","events_url":"https://api.github.com/users/luigidellaquila/events{/privacy}","received_events_url":"https://api.github.com/users/luigidellaquila/received_events","type":"User","site_admin":false},"assignees":[{"login":"luigidellaquila","id":459289,"node_id":"MDQ6VXNlcjQ1OTI4OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/459289?v=4","gravatar_id":"","url":"https://api.github.com/users/luigidellaquila","html_url":"https://github.com/luigidellaquila","followers_url":"https://api.github.com/users/luigidellaquila/followers","following_url":"https://api.github.com/users/luigidellaquila/following{/other_user}","gists_url":"https://api.github.com/users/luigidellaquila/gists{/gist_id}","starred_url":"https://api.github.com/users/luigidellaquila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigidellaquila/subscriptions","organizations_url":"https://api.github.com/users/luigidellaquila/orgs","repos_url":"https://api.github.com/users/luigidellaquila/repos","events_url":"https://api.github.com/users/luigidellaquila/events{/privacy}","received_events_url":"https://api.github.com/users/luigidellaquila/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-10-26T11:28:12Z","updated_at":"2018-11-07T09:34:40Z","closed_at":"2018-11-07T09:34:24Z","author_association":"NONE","body":"### OrientDB Version: 3.0.9\r\n### Java Version: openjdk version \"1.8.0_171\"\r\n### OS: alpine 3.8.1 (I'm using the official Docker image)\r\n\r\nGiven table such as:\r\n\r\n| @rid | @version | @class | last_name | first_name | \r\n| -- | -- | -- | -- | -- | \r\n41:0 | 1 | Test | Francescone | Onida\r\n41:1 | 1 | Test | Springham | Lauree\r\n41:2 | 1 | Test | Whal | Cory\r\n42:0 | 1 | Test | Ryan | Onida\r\n42:1 | 1 | Test | Ranking | Abran\r\n42:2 | 1 | Test | Schoales | Cory\r\n43:0 | 1 | Test | Ryan | Maximilien\r\n43:1 | 1 | Test | Stannas | Abran\r\n43:2 | 1 | Test | Schoales | Augusta\r\n44:0 | 1 | Test | Henzley | Dot\r\n44:1 | 1 | Test | Stannas | Gypsy\r\n44:2 | 1 | Test | Garrard | Walliw\r\n\r\nThen running a query with `GROUP BY` such as:\r\n\r\n```\r\nSELECT first_name + ' ' + last_name, COUNT(@rid) FROM Test GROUP BY last_name, first_name\r\n```\r\n\r\n## Expected behavior  \r\n\r\nShould group specified columns like in SQL:\r\n\r\n| first_name + ' ' + last_name | COUNT(@rid)\r\n-- | --\r\nOnida Francescone | 1\r\nLauree Springham | 1\r\nCory Whal | 1\r\nOnida Ryan | 1\r\nAbran Ranking | 1\r\nCory Schoales | 1\r\nMaximilien Ryan | 1\r\nAbran Stannas | 1\r\nAugusta Schoales | 1\r\nDot Henzley | 1\r\nGypsy Stannas | 1\r\nWalliw Garrard | 1\r\n\r\n## Actual behavior  \r\n\r\nActually groups people with same last_name to same bucket\r\n\r\n| first_name + ' ' + last_name | COUNT(@rid)\r\n-- | --\r\nOnida Francescone | 1\r\nLauree Springham | 1\r\nCory Whal | 1\r\nMaximilien Ryan | 2\r\nAbran Ranking | 1\r\nAugusta Schoales | 2\r\nGypsy Stannas | 2\r\nDot Henzley | 1\r\nWalliw Garrard | 1\r\n\r\n\r\n\r\n## Steps to reproduce  \r\n\r\nPrepare table with data:\r\n\r\n```\r\nCREATE CLASS TEST EXTENDS V;\r\nINSERT INTO Test (first_name, last_name) VALUES ('Onida', 'Francescone'),\r\n('Onida', 'Ryan'),\r\n('Maximilien', 'Ryan'),\r\n('Dot', 'Henzley'),\r\n('Lauree', 'Springham'),\r\n('Abran', 'Ranking'),\r\n('Abran', 'Stannas'),\r\n('Gypsy', 'Stannas'),\r\n('Cory', 'Whal'),\r\n('Cory', 'Schoales'),\r\n('Augusta', 'Schoales'),\r\n('Walliw', 'Garrard');\r\n```\r\n\r\nQuery:\r\n\r\n```\r\nSELECT first_name + ' ' + last_name, COUNT(@rid) FROM Test GROUP BY first_name, last_name\r\n```\r\n\r\n*Workaround:*\r\n\r\nThe query seems to give expected results when using `GROUP BY first_name + ' ' + last_name` syntax:\r\n\r\n```\r\nSELECT first_name + ' ' + last_name, COUNT(@rid) FROM Test GROUP BY first_name + ' ' + last_name\r\n```\r\n\r\nAlso when selecting first_name and last_name fields directly in SELECT the query returns results as expected.\r\n```\r\nSELECT first_name, last_name, COUNT(@rid) FROM Test GROUP BY first_name, last_name\r\n```"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/436562164","html_url":"https://github.com/orientechnologies/orientdb/issues/8625#issuecomment-436562164","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/8625","id":436562164,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjU2MjE2NA==","user":{"login":"luigidellaquila","id":459289,"node_id":"MDQ6VXNlcjQ1OTI4OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/459289?v=4","gravatar_id":"","url":"https://api.github.com/users/luigidellaquila","html_url":"https://github.com/luigidellaquila","followers_url":"https://api.github.com/users/luigidellaquila/followers","following_url":"https://api.github.com/users/luigidellaquila/following{/other_user}","gists_url":"https://api.github.com/users/luigidellaquila/gists{/gist_id}","starred_url":"https://api.github.com/users/luigidellaquila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luigidellaquila/subscriptions","organizations_url":"https://api.github.com/users/luigidellaquila/orgs","repos_url":"https://api.github.com/users/luigidellaquila/repos","events_url":"https://api.github.com/users/luigidellaquila/events{/privacy}","received_events_url":"https://api.github.com/users/luigidellaquila/received_events","type":"User","site_admin":false},"created_at":"2018-11-07T09:34:40Z","updated_at":"2018-11-07T09:34:40Z","author_association":"MEMBER","body":"Hi @josalmi \r\n\r\nI just pushed a fix, it will be released with v 3.0.11\r\n\r\nThanks\r\n\r\nLuigi"}}
{"actor":{"display_login":"luigidellaquila"}}