-
Notifications
You must be signed in to change notification settings - Fork 190
[FEATURE] Add max/min functions for eval command #4341
Copy link
Copy link
Closed
Labels
PPLPiped processing languagePiped processing languageRFCRequest For CommentsRequest For Commentscalcitecalcite migration releatedcalcite migration releatedenhancementNew feature or requestNew feature or requestv3.3.0
Description
Is your feature request related to a problem?
PPL currently lacks MAX and MIN functions for the eval command/a way to find the maximum or minimum value among multiple arguments (fields, constants) within a single row.
What solution would you like?
Add MAX(x, y, ...) and MIN(x, y, ...) functions to PPL's eval command that:
- Accept variable number of arguments
- Support mixed data types (numbers and strings) with behavior:
- MAX: Prefers strings over numbers when types are mixed
- MIN: Prefers numbers over strings when types are mixed
Example usage:
source=logs | eval result = MAX(2, 100, "banana", "apple") | fields result-> result would be "banana"source=logs | eval result = MIN(2, 100, "banana", "apple") | fields result-> result would be 2
What alternatives have you considered?
N/A
Do you have any additional context?
Add any other context or screenshots about the feature request here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PPLPiped processing languagePiped processing languageRFCRequest For CommentsRequest For Commentscalcitecalcite migration releatedcalcite migration releatedenhancementNew feature or requestNew feature or requestv3.3.0
Type
Projects
Status
New
Status
Done