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

Aggregation via json/jsonb column not possible #2

Open
lwitzani opened this issue Aug 11, 2021 · 0 comments
Open

Aggregation via json/jsonb column not possible #2

lwitzani opened this issue Aug 11, 2021 · 0 comments

Comments

@lwitzani
Copy link

Hi,
thank you for this code. I use it together with queryDsl and it works fine.
This is probably not directly connected with your code but maybe you know what the solution could be. I would like to have a simple query as the following:

SELECT entity_table.json ->> 'jsonKey'
FROM entity_table 
GROUP BY entity_table.json ->> 'jsonKey'

When i run this query it works directly on my postgres datatabase but if i build it in my spring boot java project and run it as native query or via queryDsl using your code then it won't work giving me an exception that the json column must be specified in the group by aggregation (which it obviously is).
In the queryDsl query it will contain something simimlar to group by hql_json_text(entityTable.json,?1) .

Do you have any idea how this could work? Maybe is registering a function in the dialect needed that enables aggregation of json/jsonb columns in 'group by' ?

Thank you :)

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