-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(hogql): groups support - part 1 #15231
Conversation
Fixed the tests and this is ready for a review. Since the columns change for different tables with PoE on or off ( We're changing PoE to v2 soonish anyway, and the "custom sql fields" PR will change the way fields are resolved as well, so I'm not too bothered by this right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems straightforward
Maybe one question is: should the raw versions be exposed to users? |
Good question. They can be sometimes useful to users, so hard to say. As tables they should just work when selecting (we need to select from somewhere), but we could hide them in the database scene. They could be useful for more advanced users to debug issues though 🤔. Edit: they could also be useful for "breaking out" of our |
Problem
HogQL is missing support for groups.
Changes
This is part 1 of such support. I decided to split it up into two PRs to get the easy wins out quickly, and not get stalled with support work.
database.py
into smaller files. The new changes are ingroups.py
andcohort_people.py
goe_{index}
to events to access "groups on events" properties. No support for "groups not on events" yet, see the TODO below.raw_groups
andgroups
tables. The table without "raw_" contains some SQL magic to remove duplicate fields.Todo in part 2
How did you test this code?
groups
andcohort_people
tables in the UI, with some changed rows in the database. Everything worked.