Skip to content

test(workflow-operator): add unit test coverage for IntervalJoin, JoinUtils, and OperatorGroupConstants - #5845

Merged
xuang7 merged 2 commits into
apache:mainfrom
aglinxinyuan:test-join-and-utility
Jun 21, 2026
Merged

test(workflow-operator): add unit test coverage for IntervalJoin, JoinUtils, and OperatorGroupConstants#5845
xuang7 merged 2 commits into
apache:mainfrom
aglinxinyuan:test-join-and-utility

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Pin behavior of three join/utility classes in common/workflow-operator/. No production-code changes.

Spec Source class Tests
IntervalJoinOpDescSpec IntervalJoinOpDesc 5
JoinUtilsSpec JoinUtils (object) 3
OperatorGroupConstantsSpec OperatorGroupConstants (object) 4

Behavior pinned — IntervalJoinOpDesc

Surface Contract
operatorInfo Interval Join, JOIN_GROUP; two ordered inputs (left table at PortIdentity(), right table at PortIdentity(1) depending on the left); one output
Field defaults join-key attrs null; constant == 10; includeLeftBound/includeRightBound == true
getPhysicalOp wires IntervalJoinOpExec; port identities carried; HashPartition requirement on each join key
Schema propagation merges left ⧺ right schemas, suffixing a conflicting attribute with #@1

Behavior pinned — JoinUtils.joinTuples

Surface Contract
Concatenation left + right fields merged
Skip the named join-key attribute is dropped from the right side
Conflict rename a right-side name collision is renamed with a #@1 suffix

Behavior pinned — OperatorGroupConstants

Surface Contract
Constant values the canonical group-name strings (Data Input, Join, Set, … Control Block)
OperatorGroupOrderList starts at Data Input, ends at Control Block; relational subgroups (Join/Set/Aggregate/Sort) nested under Data Cleaning; visualization subgroups nested under Visualization in panel order

Any related issues, documentation, discussions?

Closes #5840.

How was this PR tested?

  • sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.intervalJoin.IntervalJoinOpDescSpec org.apache.texera.amber.operator.hashJoin.JoinUtilsSpec org.apache.texera.amber.operator.metadata.OperatorGroupConstantsSpec" — 12 tests, all green
  • sbt "WorkflowOperator/Test/scalafmtCheck" and sbt "WorkflowOperator/Test/scalafix --check" — clean
  • CI to confirm

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

Generated-by: Claude Code (Opus 4.8 [1M context])

…nUtils, and OperatorGroupConstants

Pin behavior of three join/utility classes:
  - IntervalJoinOpDesc: operatorInfo (Interval Join, JOIN_GROUP, two ordered inputs left/right with right depending on left); getPhysicalOp wires IntervalJoinOpExec + a HashPartition requirement on each join key; schema propagation merges left++right schemas, suffixing a conflicting attribute with #@1; field round-trip
  - JoinUtils.joinTuples: concatenates left+right fields; skips the named join-key attribute from the right; renames a right-side name conflict with #@1
  - OperatorGroupConstants: pins the canonical group-name string values and the OperatorGroupOrderList hierarchy (relational subgroups under Data Cleaning; visualization subgroups under Visualization, in panel order)

12 new tests; scalafmtCheck + scalafixAll --check clean; no production-code changes.
Copilot AI review requested due to automatic review settings June 21, 2026 04:37

Copilot AI 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.

Pull request overview

Adds ScalaTest unit specs under common/workflow-operator/ to pin existing behavior of join-related descriptors/utilities and operator-group metadata, without changing production code.

Changes:

  • Add IntervalJoinOpDescSpec to pin IntervalJoinOpDesc defaults, operatorInfo wiring, schema propagation, and JSON round-trip behavior.
  • Add JoinUtilsSpec to pin JoinUtils.joinTuples concatenation, skip-attribute, and conflict-renaming behavior.
  • Add OperatorGroupConstantsSpec to pin operator group names and the OperatorGroupOrderList nesting/order.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/metadata/OperatorGroupConstantsSpec.scala New spec for operator group constant values and group ordering/nesting
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/intervalJoin/IntervalJoinOpDescSpec.scala New spec covering IntervalJoin operator descriptor behavior and schema propagation
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/hashJoin/JoinUtilsSpec.scala New spec covering JoinUtils tuple-merge behavior (skip + rename conflicts)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter

codecov-commenter commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.86%. Comparing base (6d31f46) to head (2d1c0c8).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5845      +/-   ##
============================================
- Coverage     53.86%   53.86%   -0.01%     
+ Complexity     2756     2754       -2     
============================================
  Files          1099     1099              
  Lines         42541    42541              
  Branches       4577     4577              
============================================
- Hits          22916    22913       -3     
  Misses        18290    18290              
- Partials       1335     1338       +3     
Flag Coverage Δ *Carryforward flag
access-control-service 70.44% <ø> (ø)
agent-service 34.36% <ø> (ø) Carriedforward from 73dbdbc
amber 55.18% <ø> (-0.02%) ⬇️
computing-unit-managing-service 1.65% <ø> (ø)
config-service 56.71% <ø> (ø)
file-service 57.06% <ø> (ø)
frontend 48.05% <ø> (ø) Carriedforward from 73dbdbc
pyamber 90.13% <ø> (ø) Carriedforward from 73dbdbc
python 90.80% <ø> (ø) Carriedforward from 73dbdbc
workflow-compiling-service 58.69% <ø> (ø)

*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

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

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

Compared against main 6d31f46 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 385 0.235 25,977/30,792/30,792 us 🔴 +19.4% / 🟢 -12.0%
🔴 bs=100 sw=10 sl=64 791 0.483 125,429/152,258/152,258 us 🔴 +10.6% / 🔴 +11.7%
bs=1000 sw=10 sl=64 921 0.562 1,090,982/1,123,263/1,123,263 us ⚪ within ±5% / 🔴 +12.2%
Baseline details

Latest main 6d31f46 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 385 tuples/sec 410 tuples/sec 410.82 tuples/sec -6.1% -6.3%
bs=10 sw=10 sl=64 MB/s 0.235 MB/s 0.25 MB/s 0.251 MB/s -6.0% -6.3%
bs=10 sw=10 sl=64 p50 25,977 us 21,753 us 23,785 us +19.4% +9.2%
bs=10 sw=10 sl=64 p95 30,792 us 35,910 us 34,980 us -14.3% -12.0%
bs=10 sw=10 sl=64 p99 30,792 us 35,910 us 34,980 us -14.3% -12.0%
bs=100 sw=10 sl=64 throughput 791 tuples/sec 830 tuples/sec 891.94 tuples/sec -4.7% -11.3%
bs=100 sw=10 sl=64 MB/s 0.483 MB/s 0.506 MB/s 0.544 MB/s -4.5% -11.3%
bs=100 sw=10 sl=64 p50 125,429 us 119,669 us 112,277 us +4.8% +11.7%
bs=100 sw=10 sl=64 p95 152,258 us 137,669 us 139,802 us +10.6% +8.9%
bs=100 sw=10 sl=64 p99 152,258 us 137,669 us 139,802 us +10.6% +8.9%
bs=1000 sw=10 sl=64 throughput 921 tuples/sec 917 tuples/sec 1,041 tuples/sec +0.4% -11.5%
bs=1000 sw=10 sl=64 MB/s 0.562 MB/s 0.559 MB/s 0.635 MB/s +0.5% -11.6%
bs=1000 sw=10 sl=64 p50 1,090,982 us 1,092,524 us 972,714 us -0.1% +12.2%
bs=1000 sw=10 sl=64 p95 1,123,263 us 1,124,173 us 1,023,057 us -0.1% +9.8%
bs=1000 sw=10 sl=64 p99 1,123,263 us 1,124,173 us 1,023,057 us -0.1% +9.8%
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,519.18,200,128000,385,0.235,25976.84,30791.50,30791.50
1,100,10,64,20,2526.97,2000,1280000,791,0.483,125428.91,152257.52,152257.52
2,1000,10,64,20,21722.70,20000,12800000,921,0.562,1090981.70,1123262.87,1123262.87

…me value

Address Copilot review feedback on apache#5845: the value-pinning test asserted only a
subset of constants while its name implied full coverage. It now asserts all 28
group-name constants (Database/API/UDF/ML/Sklearn/HuggingFace + every visualization
subgroup), matching the test name.

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@xuang7 xuang7 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!

@xuang7
xuang7 added this pull request to the merge queue Jun 21, 2026
Merged via the queue into apache:main with commit 5882434 Jun 21, 2026
20 checks passed
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 24, 2026
…nUtils, and OperatorGroupConstants (apache#5845)

### What changes were proposed in this PR?

Pin behavior of three join/utility classes in
`common/workflow-operator/`. No production-code changes.

| Spec | Source class | Tests |
| --- | --- | --- |
| `IntervalJoinOpDescSpec` | `IntervalJoinOpDesc` | 5 |
| `JoinUtilsSpec` | `JoinUtils` (object) | 3 |
| `OperatorGroupConstantsSpec` | `OperatorGroupConstants` (object) | 4 |

**Behavior pinned — `IntervalJoinOpDesc`**

| Surface | Contract |
| --- | --- |
| `operatorInfo` | `Interval Join`, JOIN_GROUP; two ordered inputs
(`left table` at `PortIdentity()`, `right table` at `PortIdentity(1)`
depending on the left); one output |
| Field defaults | join-key attrs `null`; `constant == 10`;
`includeLeftBound`/`includeRightBound == true` |
| `getPhysicalOp` | wires `IntervalJoinOpExec`; port identities carried;
`HashPartition` requirement on each join key |
| Schema propagation | merges left ⧺ right schemas, suffixing a
conflicting attribute with `#@1` |

**Behavior pinned — `JoinUtils.joinTuples`**

| Surface | Contract |
| --- | --- |
| Concatenation | left + right fields merged |
| Skip | the named join-key attribute is dropped from the right side |
| Conflict rename | a right-side name collision is renamed with a `#@1`
suffix |

**Behavior pinned — `OperatorGroupConstants`**

| Surface | Contract |
| --- | --- |
| Constant values | the canonical group-name strings (`Data Input`,
`Join`, `Set`, … `Control Block`) |
| `OperatorGroupOrderList` | starts at `Data Input`, ends at `Control
Block`; relational subgroups (Join/Set/Aggregate/Sort) nested under
`Data Cleaning`; visualization subgroups nested under `Visualization` in
panel order |

### Any related issues, documentation, discussions?

Closes apache#5840.

### How was this PR tested?

- `sbt "WorkflowOperator/testOnly
org.apache.texera.amber.operator.intervalJoin.IntervalJoinOpDescSpec
org.apache.texera.amber.operator.hashJoin.JoinUtilsSpec
org.apache.texera.amber.operator.metadata.OperatorGroupConstantsSpec"` —
12 tests, all green
- `sbt "WorkflowOperator/Test/scalafmtCheck"` and `sbt
"WorkflowOperator/Test/scalafix --check"` — clean
- CI to confirm

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

Generated-by: Claude Code (Opus 4.8 [1M context])
@aglinxinyuan
aglinxinyuan deleted the test-join-and-utility branch July 19, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit test coverage for join operator descriptor and operator utilities (IntervalJoin, JoinUtils, OperatorGroupConstants)

4 participants