Skip to content

Fix NotUdf loading and refresh stale UDF snapshots - #19108

Open
spapin wants to merge 2 commits into
apache:masterfrom
spapin:fix-udf-loading-upstream
Open

Fix NotUdf loading and refresh stale UDF snapshots#19108
spapin wants to merge 2 commits into
apache:masterfrom
spapin:fix-udf-loading-upstream

Conversation

@spapin

@spapin spapin commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

NotUdf fails to load via ServiceLoader because its reflection lookup is out of sync with LogicalFunctions.not()'s signature, which was changed to Boolean (boxed) for three-valued NULL semantics but the UDF lookup still uses boolean.class (primitive). This throws NoSuchMethodException at construction time, breaking UdfTest at setUp().

This PR:

  • Fixes NotUdf's getMethod lookup to use Boolean.class, matching the actual signature.
  • Refreshes the stale abs.yaml / all-functions.yaml snapshot fixtures so UdfTest's snapshot comparison matches the currently-registered scalar functions (adds recently-added trig/bitwise/IP/string helpers, fixes a stale and entry, updates abs from "3.0" to the integer-typed "3").

Test plan

UdfTest currently fails on master with NoSuchMethodException before even reaching the snapshot comparisons it's meant to run. Reproduce with:

./mvnw -pl pinot-integration-tests -am -Dtest=UdfTest -Dsurefire.failIfNoSpecifiedTests=false test

With this fix applied, the suite passes.

Note: this test class currently isn't picked up by either CI integration-test shard (integration-tests-set-1/integration-tests-set-2 in pinot-integration-tests/pom.xml), since its package (org.apache.pinot.integration.tests.udf) isn't matched by the shard include globs. That's a separate, pre-existing gap to be addressed independently.

spapin added 2 commits July 28, 2026 11:12
LogicalFunctions.not() was changed to accept @nullable Boolean (boxed)
for three-valued NULL semantics, but NotUdf still looked up the method
with boolean.class (primitive). ServiceLoader threw
NoSuchMethodException at construction time, making the entire UdfTest
suite fail during setUp.

Change the Class.getMethod() call to use Boolean.class to match the
actual method signature.
Regenerate all-functions.yaml and abs.yaml so the UdfTest snapshot
comparison matches current code: add the recently registered scalar
functions (trigonometric, bitwise, IP, string helpers), fix the `and`
entry that still showed `scalar: null`, and update `abs` from "3.0" to
the integer-typed "3" produced by the now-polymorphic implementation.
These snapshots were stale and failed the suite regardless of fork count.
@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 65.51%. Comparing base (a8b207e) to head (2112d3d).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...rg/apache/pinot/query/runtime/function/NotUdf.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #19108      +/-   ##
============================================
+ Coverage     65.49%   65.51%   +0.01%     
  Complexity     1423     1423              
============================================
  Files          3430     3430              
  Lines        218010   218010              
  Branches      34648    34648              
============================================
+ Hits         142784   142821      +37     
+ Misses        63666    63631      -35     
+ Partials      11560    11558       -2     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-25 65.51% <0.00%> (+0.01%) ⬆️
temurin 65.51% <0.00%> (+0.01%) ⬆️
unittests 65.50% <0.00%> (+0.01%) ⬆️
unittests1 56.88% <0.00%> (+0.01%) ⬆️
unittests2 37.86% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@spapin

spapin commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

those tests don't run in CI, that's why they were broken and missed. next PR I'll re-enable them.

@spapin
spapin marked this pull request as ready for review July 29, 2026 19:46
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.

2 participants