Skip to content

Conversation

yakkomajuri
Copy link
Contributor

Just putting this up as I've been spending a good amount of time on it (and have other things to do) while I feel it might be a quick thing for @mariusandra.

Essentially, seems most of the PoE v2 stuff is in place here, but I need the person_id field in PoE v2 to be an alias to if(notEmpty(...), ...) seems I'd need to edit the printer to do this? Could probably figure out a way but wondering what the suggested approach here would be

@yakkomajuri yakkomajuri requested a review from mariusandra April 17, 2023 20:54
@yakkomajuri yakkomajuri marked this pull request as draft April 17, 2023 20:54
@yakkomajuri
Copy link
Contributor Author

@mariusandra any thoughts?

@yakkomajuri yakkomajuri mentioned this pull request Apr 20, 2023
11 tasks
@mariusandra
Copy link
Collaborator

It took a few stacked PRs of refactors, but I got a more or less clean version of custom sql fields ready. It's still a draft and I'm actively watering its prerequisite. So soon, soon.

However you can rebase and play with it. It should fit into the PoEv2 system nicely, though I didn't try it yet myself.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@mariusandra
Copy link
Collaborator

Not stale. Will get back on it next week.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@posthog-bot
Copy link
Contributor

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

@mariusandra
Copy link
Collaborator

@yakkomajuri let's split the PoE work at HogQL into two parts:

  1. Joining the new person_id onto events as override_person_id, similar to person_id and other things are joined now
  2. Actually having a seamless experience with a hidden if() when selecting person.properties feat(hogql): custom SQL columns #15180

I merged with master and started to cleaning up the person_overrides table you added here, only to realise we have 4 identical tables we select from with argmax joins. Thus it was time for a common solution (and one more step towards becoming an ORM 😅).

This PR now adds:

  • events.override.* as a link to the last person_overrides table row for that distinct_id
  • events.override_person_id as a shorthand to access the new person_id
  • A new specific error "Can't select a table when a column is expected" to spark just a tiny bit more joy

If you find this all a-OK and the tests pass, I'll happily ✅ and 🚢 🇮🇹

@mariusandra mariusandra marked this pull request as ready for review June 1, 2023 21:39
@mariusandra
Copy link
Collaborator

I'd like to test PoEv2 locally. Are there any specific flags I can enable and things I can do to get any data to come in to the person_overrides table? I was flying blind until now :)

@mariusandra mariusandra requested review from thmsobrmlr and Twixes June 2, 2023 07:43
@mariusandra mariusandra changed the title feat(hogql): WIP add poe v2 support feat(hogql): add poe v2 support Jun 5, 2023
@mariusandra mariusandra merged commit b8ff03c into master Jun 5, 2023
@mariusandra mariusandra deleted the hogql-poe-v2 branch June 5, 2023 07:36
@mariusandra
Copy link
Collaborator

I merged this PR in (despite my own many changes), as it is just step 1 in poev2 support that adds a table we can query in step 2. Plus it improves some errors I just saw in #sentry.

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.

3 participants