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

feat(hogql): really lazy tables #14927

Merged
merged 31 commits into from
Apr 6, 2023
Merged

feat(hogql): really lazy tables #14927

merged 31 commits into from
Apr 6, 2023

Conversation

mariusandra
Copy link
Collaborator

@mariusandra mariusandra commented Mar 29, 2023

Problem

We had support for "lazy tables", but only as parts of a join.

Changes

Makes it possible to select from virtual tables constructed for you via subqueries. Those subqueries carry over all fields accessed from them, and manipulate them as needed.

E.g. select email from lazy_persons --> select email from (select argMax(mat_email, version) as email from persons)

This makes it easy to select from persons without worrying about the underlining deduping logic.

How did you test this code?

Tested with queries in the interface and wrote a bunch of tests.

@mariusandra mariusandra marked this pull request as ready for review March 30, 2023 21:31
@mariusandra
Copy link
Collaborator Author

mariusandra commented Mar 30, 2023

@Twixes This is ready for review!

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

@thmsobrmlr thmsobrmlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted
  • firefox: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@mariusandra mariusandra enabled auto-merge (squash) April 6, 2023 13:38
@mariusandra mariusandra merged commit 399769d into master Apr 6, 2023
@mariusandra mariusandra deleted the really-lazy-tables branch April 6, 2023 13:48
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