Add OPL query-engine starts_with and ends_with functions#2825
Draft
truffle-dev wants to merge 1 commit intoopen-telemetry:mainfrom
Draft
Add OPL query-engine starts_with and ends_with functions#2825truffle-dev wants to merge 1 commit intoopen-telemetry:mainfrom
truffle-dev wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
Wires the upstream datafusion `starts_with` and `ends_with` UDFs into the OPL query engine via the existing `InvokeFunctionExpr` path. Both return Boolean and use `requires_dict_downcast: true`, matching the sha256 wiring. Each adds a function-name constant, a parser registration with two parameter placeholders, and a `from_func_name` arm in the DataFusion planner. Tests: unit tests in `expr.rs` (direct `InvokeFunctionExpr` planning + execution against logs `event_name`) and end-to-end OPL filter tests in `filter.rs` covering both string and attribute scopes, with column on either side of the predicate. Closes open-telemetry#2819 Signed-off-by: truffle <truffleagent@gmail.com>
|
Member
albertlockett
left a comment
There was a problem hiding this comment.
@truffle-dev can you please sign the CLA? #2825 (comment)
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2825 +/- ##
==========================================
+ Coverage 86.04% 86.05% +0.01%
==========================================
Files 704 704
Lines 264654 264833 +179
==========================================
+ Hits 227719 227903 +184
+ Misses 36411 36406 -5
Partials 524 524
🚀 New features to boost your workflow:
|
albertlockett
approved these changes
May 5, 2026
jmacd
approved these changes
May 5, 2026
Contributor
|
I will mark this draft @truffle-dev; this is a welcome change, thank you. |
auto-merge was automatically disabled
May 7, 2026 04:27
Pull request was converted to draft
Author
|
Thanks for the patience. The EasyCLA failure traces to LFX needing a fresh GitHub OAuth login on truffle-dev, which the account can't complete until 2FA is enabled. Working on getting that flipped. Marking it draft is reasonable while that's pending; I'll sign and re-request review once 2FA is in place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2819
Wires the upstream datafusion
starts_withandends_withUDFs into the OPL query engine via the existingInvokeFunctionExprpath. Each function adds:consts.rsparser.rs::default_parser_optionsfrom_func_namearm inDataFusionFunctionDef(expr.rs) returningExprLogicalType::Booleanwithrequires_dict_downcast: true, matching the sha256 wiringExample queries that now work:
Tests
expr.rsbuild theInvokeFunctionScalarExpressiondirectly, plan, execute against aLogsrecord batch, and assert aBooleanArrayresult. Patterned ontest_function_invocation_sha256.filter.rscoverevent_nameandattributes["..."]arguments, with the column on either side of the predicate.Validation
cargo check -p otap-df-query-engine: cleancargo test -p otap-df-query-engine: 548 passed (4 new filter tests, 2 new expr tests)cargo clippy -p otap-df-query-engine --all-targets -- -D warnings: cleancargo fmt --all -- --check: cleancargo xtask quick-check: cleanNotes
bodyfield tests are intentionally omitted because OTLPbodyis heterogeneous (AnyValuewith string + int variants). The upstream datafusion UDFs reject mixed types directly.containsworks there because it has a custom string-coercing wrapper UDF; aligningstarts_with/ends_withto that wrapper pattern is a follow-up beyond the scope of #2819, which asks specifically for the upstream UDFs.