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

Add "let" operator #40

Closed
abraithwaite opened this issue Feb 29, 2024 · 0 comments · Fixed by #52 · May be fixed by #42
Closed

Add "let" operator #40

abraithwaite opened this issue Feb 29, 2024 · 0 comments · Fixed by #52 · May be fixed by #42

Comments

@abraithwaite
Copy link
Member

The let operator allows users to assign variables to be used in queries. Example follows.

let n = 10;  // number
let place = "Dallas";  // string
let cutoff = ago(62d); // datetime 
Events 
| where timestamp > cutoff 
    and city == place 
| take n

Kusto docs:

https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/let-statement

@zombiezen zombiezen linked a pull request Jun 6, 2024 that will close this issue
zombiezen added a commit that referenced this issue Jun 11, 2024
Add `let` statement.
Requires a breaking change in API to parser.Parse to support multiple statements,
but pql.Compile does not change.
The REPL also required some tweaking.

Fixes #40
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 a pull request may close this issue.

1 participant