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

[FEATURE]Add PPL eval CASE funcitonality support #645

Open
YANG-DB opened this issue Sep 11, 2024 · 1 comment
Open

[FEATURE]Add PPL eval CASE funcitonality support #645

YANG-DB opened this issue Sep 11, 2024 · 1 comment
Labels
enhancement New feature or request PPL Pipe Processing Language support

Comments

@YANG-DB
Copy link
Member

YANG-DB commented Sep 11, 2024

Is your feature request related to a problem?
Current CASE functionality syntax is only available in SQL query, this functionality is important for actual use cases for Observability and in addition more general cases where eval CASE add helpful functionality to the query.

What solution would you like?
The case command will be constructed using a list of predicates and an optional ELSE default value.

CASE(<predicate1>, <value1>, [<predicate2>, <value2>, ...] [ELSE] <default>)

ELSE could be optional, removing it will save an additional keyword in PPL. It is also more like a function than a clause.

An example:

source = my_index
| eval status_category =
    case(status_code >= 200 AND status_code < 300, 'Success',
         status_code >= 300 AND status_code < 400, 'Redirection'
         status_code >= 400 AND status_code < 500, 'Client Error'
         status_code >= 500, 'Server Error',
         'Unknown')
| stats count() by status_category

Do you have any additional context?

@YANG-DB YANG-DB added enhancement New feature or request untriaged PPL Pipe Processing Language support labels Sep 11, 2024
@YANG-DB YANG-DB self-assigned this Sep 13, 2024
@YANG-DB YANG-DB removed the untriaged label Sep 14, 2024
@YANG-DB YANG-DB mentioned this issue Sep 16, 2024
@YANG-DB YANG-DB removed their assignment Sep 19, 2024
@YANG-DB
Copy link
Member Author

YANG-DB commented Sep 19, 2024

@lukasz-soszynski-eliatra can you please continue the work from the previous isEmpty task and implement the CASE support as well ?
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PPL Pipe Processing Language support
Projects
Status: Todo
Development

No branches or pull requests

1 participant