-
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
fix(hogql): proper datetime aliases for select columns #15970
Conversation
|
||
def visit(self, node): | ||
def visit(self, node: ast.AST, tag: Optional[str] = None): |
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.
So tag
is clunky and ambiguous. I think the real issue here is that the AST has no concept of a column , which is key, as a column is a very special case of an expression (columnExpr
in the syntax). The rule is basically: ast.Alias
is allowed as an ast.Column
expr, and nowhere else. So if we have ast.Column
, we'll be able to check whether the parent allows ast.Alias
simply using stack
.
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 |
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 |
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 |
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 |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
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 |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
Problem
Grouping by timestamp selected from events in a subquery doesn't work. That's because we replace timestamps with
toTimeZone(events.timestamp, 'Your/Timezone')
, but without anas timestamp
in the end, we can't reference this field from within a subquery.Changes
as timestamp
to the end of selected timestamps.Feedback on this approach is very welcome.
How did you test this code?
Wrote tests