Skip to content

feat(expression): add subList function and standardize argument validation#5588

Open
saketh-pallempati wants to merge 3 commits into
opensearch-project:mainfrom
fidelity-contributions:fix-issue-5529
Open

feat(expression): add subList function and standardize argument validation#5588
saketh-pallempati wants to merge 3 commits into
opensearch-project:mainfrom
fidelity-contributions:fix-issue-5529

Conversation

@saketh-pallempati
Copy link
Copy Markdown
Contributor

@saketh-pallempati saketh-pallempati commented Apr 8, 2025

Description

  • Introduced SubListExpressionFunction to support extracting a sublist from an event field.
  • Modified function argument handling to accept integer types directly.
  • Updated all expression functions to throw IllegalArgumentException for invalid arguments.
  • Moved granular type-checking and argument validation responsibilities to individual functions, simplifying the parser and evaluator logic.

Issues Resolved

Resolves #5529

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…ation

- Introduced SubListExpressionFunction to support extracting a sublist from an event field.
- Modified function argument handling to accept integer types directly.
- Updated all expression functions to throw IllegalArgumentException for invalid arguments.
- Moved granular type-checking and argument validation responsibilities to individual functions,
  simplifying the parser and evaluator logic.

Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
@saketh-pallempati
Copy link
Copy Markdown
Contributor Author

saketh-pallempati commented Apr 8, 2025

I will raise the documentation issue if the changes are considered by the team.
I commented on the issue #5529 but others submitted a good PR too.
I tested it end-to-end and many useful changes are made please do review.

To solve the flaky TimeZoneHelper utility and corresponding test case
Comment thread data-prepper-expression/src/main/antlr/DataPrepperExpression.g4
Signed-off-by: Pallempati Saketh <pallempati.saketh@fmr.com>
@saketh-pallempati
Copy link
Copy Markdown
Contributor Author

Hi @dlvenable I made the changes required. Please do check and let me know

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.

Support extracting subLists from a list

2 participants