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(hog): parser updates for lambdas #24575

Merged
merged 15 commits into from
Aug 27, 2024
Merged

feat(hog): parser updates for lambdas #24575

merged 15 commits into from
Aug 27, 2024

Conversation

mariusandra
Copy link
Collaborator

@mariusandra mariusandra commented Aug 26, 2024

Problem

Splitting out work from #24369

Changes

  • Implements parsing of lambdas x -> x everywhere
  • Add support for blocks with lambdas (x, y) -> { a(x); y; }
  • Lambdas are now a standard columnExpr --> removes special columnArg
  • ClickHouse supports two sets of args on a function: fn(parameters)(arguments) (params & args). Fix a parser bug in the existing code when params were there, but an empty list.
  • Implements expression call parsing (calls on non-identifiers like asd[0].foo[1]())
  • Disables expression calls and lambas with blocks when printing SQL

How did you test this code?

Added and updated tests

@posthog-bot
Copy link
Contributor

It looks like the code of hogql-parser has changed since last push, but its version stayed the same at 1.0.38. 👀
Make sure to resolve this in hogql_parser/setup.py before merging!

@mariusandra
Copy link
Collaborator Author

mariusandra commented Aug 26, 2024

It looks like the code of hogql-parser has changed since last push, but its version stayed the same at 1.0.38. 👀 Make sure to resolve this in hogql_parser/setup.py before merging!

The parser was released in the root PR with these same changes under the 1.0.38 version. This error can be ignored.

@mariusandra mariusandra requested a review from a team August 26, 2024 14:23
@mariusandra mariusandra marked this pull request as ready for review August 26, 2024 14:23
@mariusandra mariusandra changed the base branch from master to hogvm-serialization August 26, 2024 18:47
Base automatically changed from hogvm-serialization to master August 27, 2024 07:45
Copy link
Contributor

@benjackwhite benjackwhite left a comment

Choose a reason for hiding this comment

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

"yeah, looks like code"

@mariusandra mariusandra merged commit 397919d into master Aug 27, 2024
89 checks passed
@mariusandra mariusandra deleted the lambda-parser branch August 27, 2024 09:21
daibhin added a commit that referenced this pull request Aug 27, 2024
Copy link

sentry-io bot commented Aug 28, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ QueryError: You can only call simple functions in HogQL, not expressions posthog.tasks.tasks.process_query_task View Issue
  • ‼️ QueryError: You can only call simple functions in HogQL, not expressions posthog.tasks.tasks.process_query_task View Issue
  • ‼️ QueryError: You can only call simple functions in HogQL, not expressions posthog.tasks.tasks.process_query_task View Issue
  • ‼️ QueryError: You can only call simple functions in HogQL, not expressions posthog.tasks.tasks.process_query_task View Issue
  • ‼️ QueryError: You can only call simple functions in HogQL, not expressions posthog.tasks.tasks.process_query_task View Issue

Did you find this useful? React with a 👍 or 👎

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