-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore(data-warehouse): joins on views #21151
Conversation
|
||
def get_child(self, name: str, context: HogQLContext) -> Type: | ||
if name == "*": | ||
return AsteriskType(table_type=self) | ||
if self.view_name: | ||
field = context.database.get_table(self.view_name).get_field(name) | ||
if isinstance(field, LazyJoin): |
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.
TODO: this resolution logic is repeated from BaseTableType
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 looks like it would work, but I wonder if this is inflating the responsibilities of SelectQueryAliasType
just a bit? Seeing a view_type
in that class doesn't tell me much about why it's there (and why it's not on e.g. SelectQueryType
?).
This should either get a comment explaining its purpose... or alternatively I think a better approach is to create SelectViewType
, either deriving from BaseTableType
directly, or then as another entry in TableOrSelectType
.
Note: this TableType
could probably be renamed SelectTableType
. TableAliasType
to SelectTableAliasType
, etc.
Problem
Changes
👉 Stay up-to-date with PostHog coding conventions for a smoother review.
Does this work well for both Cloud and self-hosted?
How did you test this code?