Skip to content

refactor(workflow-operator): dedupe the aggregation numeric guard - #9601

Open
Ma77Ball wants to merge 1 commit into
apache:mainfrom
Ma77Ball:refactor/aggregation-numeric-guard
Open

Ma77Ball wants to merge 1 commit into
apache:mainfrom
Ma77Ball:refactor/aggregation-numeric-guard

Conversation

@Ma77Ball

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • The numeric-type guard shared by sum, min, and max aggregations (reject anything but INTEGER, DOUBLE, LONG, TIMESTAMP) is extracted into one requireNumericType helper; the three call it with their name, preserving the same error messages and behavior.

Any related issues, documentation, discussions?

Closes: #9600

How was this PR tested?

  • Run sbt "WorkflowOperator/testOnly *Aggregat*" under JDK 17; expect 82 passing across the aggregation specs (no-behavior-change refactor, covered by the existing suites).

Was this PR authored or co-authored using generative AI tooling?

Co-authored with Claude Opus 4.8 in compliance with ASF

…ations

sumAgg, minAgg, and maxAgg each repeated the same four-type check (INTEGER, DOUBLE, LONG, TIMESTAMP) that throws UnsupportedOperationException for any other attribute type. The check is now one requireNumericType helper the three aggregations call with their name, keeping the same error messages and behavior.
@github-actions github-actions Bot added refactor Refactor the code common labels Nov 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @eugenegujing
    You can notify them by mentioning @eugenegujing in a comment.

@codecov-commenter

codecov-commenter commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.58%. Comparing base (7f9bdf3) to head (ba47e73).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9601      +/-   ##
============================================
+ Coverage     91.57%   91.58%   +0.01%     
- Complexity     5158     5174      +16     
============================================
  Files          1300     1300              
  Lines         58092    58122      +30     
  Branches       7615     7609       -6     
============================================
+ Hits          53195    53231      +36     
  Misses         2959     2959              
+ Partials       1938     1932       -6     
Flag Coverage Δ *Carryforward flag
access-control-service 77.44% <ø> (ø)
agent-service 99.56% <ø> (ø) Carriedforward from 7f9bdf3
amber 85.48% <100.00%> (+0.04%) ⬆️
computing-unit-managing-service 63.88% <ø> (ø)
config-service 87.50% <ø> (ø)
file-service 82.16% <ø> (ø)
frontend 96.45% <ø> (ø) Carriedforward from 7f9bdf3
notebook-migration-service 83.77% <ø> (ø)
pyamber 98.38% <ø> (ø) Carriedforward from 7f9bdf3
result-service 85.71% <ø> (ø)
workflow-compiling-service 78.30% <ø> (ø)

*This pull request uses carry forward flags. 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.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 5 worse · ⚪ 8 noise (<±5%) · 0 without baseline

Compared against main 9647f58 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🔴 bs=10 sw=10 sl=64 407 0.248 24,577/31,580/31,580 us 🔴 +24.9% / 🔴 +142.5%
⚪ bs=100 sw=10 sl=64 854 0.521 113,317/134,120/134,120 us ⚪ within ±5% / 🔴 +54.1%
🔴 bs=1000 sw=10 sl=64 953 0.582 1,034,280/1,329,514/1,329,514 us 🔴 +16.3% / 🔴 +63.3%
Baseline details

Latest main 9647f58 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 407 tuples/sec 436 tuples/sec 1,019 tuples/sec -6.7% -60.1%
bs=10 sw=10 sl=64 MB/s 0.248 MB/s 0.266 MB/s 0.622 MB/s -6.8% -60.1%
bs=10 sw=10 sl=64 p50 24,577 us 19,677 us 10,136 us +24.9% +142.5%
bs=10 sw=10 sl=64 p95 31,580 us 40,118 us 13,860 us -21.3% +127.8%
bs=10 sw=10 sl=64 p99 31,580 us 40,118 us 16,484 us -21.3% +91.6%
bs=100 sw=10 sl=64 throughput 854 tuples/sec 879 tuples/sec 1,363 tuples/sec -2.8% -37.4%
bs=100 sw=10 sl=64 MB/s 0.521 MB/s 0.537 MB/s 0.832 MB/s -3.0% -37.4%
bs=100 sw=10 sl=64 p50 113,317 us 113,491 us 79,194 us -0.2% +43.1%
bs=100 sw=10 sl=64 p95 134,120 us 133,325 us 87,022 us +0.6% +54.1%
bs=100 sw=10 sl=64 p99 134,120 us 133,325 us 106,894 us +0.6% +25.5%
bs=1000 sw=10 sl=64 throughput 953 tuples/sec 963 tuples/sec 1,407 tuples/sec -1.0% -32.3%
bs=1000 sw=10 sl=64 MB/s 0.582 MB/s 0.588 MB/s 0.859 MB/s -1.0% -32.2%
bs=1000 sw=10 sl=64 p50 1,034,280 us 1,031,032 us 776,422 us +0.3% +33.2%
bs=1000 sw=10 sl=64 p95 1,329,514 us 1,143,219 us 814,091 us +16.3% +63.3%
bs=1000 sw=10 sl=64 p99 1,329,514 us 1,143,219 us 860,577 us +16.3% +54.5%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,491.39,200,128000,407,0.248,24576.86,31579.51,31579.51
1,100,10,64,20,2342.69,2000,1280000,854,0.521,113317.07,134120.21,134120.21
2,1000,10,64,20,20977.25,20000,12800000,953,0.582,1034279.54,1329514.09,1329514.09

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Nov 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 21, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common refactor Refactor the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract the duplicated numeric-type guard in aggregations

3 participants