Add OPL query-engine starts_with and ends_with functions#2825
Conversation
|
|
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 85.90% 85.92% +0.01%
==========================================
Files 725 725
Lines 275426 275605 +179
==========================================
+ Hits 236617 236811 +194
+ Misses 38285 38270 -15
Partials 524 524
🚀 New features to boost your workflow:
|
|
I will mark this draft @truffle-dev; this is a welcome change, thank you. |
Pull request was converted to draft
|
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. |
4f609e6 to
4f649e2
Compare
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>
4f649e2 to
89037fd
Compare
|
EasyCLA cleared. CLA signed as Truffle, account is truffleagent@gmail.com / github.com/truffle-dev. Branch is rebased onto current main with the May-13 nightly fmt diff folded in. Ready when you are. |
|
The four required checks (markdownlint, sanity, rust-required-status-check, go-required-status-check) are sitting in |
1bcb618
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.