aglinxinyuan opened a new issue, #7868:
URL: https://github.com/apache/texera/issues/7868

   ### Task Summary
   
   
`common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/source/sql/SQLSourceOpExec.scala`
 reads as a 24-line gap: 85.3% with 4 missed and 20 partial of 163 lines, and 
43 of 170 branch arms uncovered.
   
   **It is really an 8-line opportunity**, and establishing that first matters 
— an assessment that counts all 24 sends someone after 16 lines that do not 
exist:
   
   - **Four `case A | B | C | _ =>` wildcard arms** (lines 230, 286, 320, 357) 
have a structurally dead `ifeq` side: scalac compiles the `_` as a constant 
before the final branch, so each line keeps at least one missed arm forever.
   - **Ten lines are sealed-`Option` `None$.equals` checks** whose false side 
falls through to `new scala/MatchError`, plus an `$outer` null check and a 
non-local-return rethrow.
   - **Line 502's `batchByAttribute.isDefined` false arm is dead.** 
`initBatchColumnBoundaries` is `private` with one caller, `open()`, which 
always assigns `Option(schema.getAttribute(...))` — and `Schema.getAttribute` 
*throws* rather than returning null, so the `Option` is always `Some`. Widening 
the private would be a production change.
   - **Line 472's `if (limit > 0)` false arm is unreachable.** `getNextQuery` 
reaches it only after `generateSqlQuery` returned `Some`, and 
`generateSqlQuery` returns `None` whenever the limit is `Some(n <= 0)`. 
Reaching it requires overriding the protected `generateSqlQuery` in the test 
subclass — i.e. replacing the code under test.
   
   Two mechanical traps:
   
   1. **A bare `WorkflowOperator/jacoco` produces an all-zero report on some 
machines.** `FileScanSourceOpExecSpec` aborts locally (pre-existing and 
unrelated — it writes fixtures into `src/test/resources` in `beforeAll`), and 
because sbt-jacoco runs unforked, a failing test task skips `saveRuntimeData` 
entirely. Exclude that suite by name in both the before and after run. Its 
abort also leaves an untracked 
`common/workflow-operator/src/test/resources/test_large_binary.txt` behind — 
delete it before committing.
   2. **`Test/scalafmtCheck` will fail on new additions** until 
`WorkflowOperator/Test/scalafmt` is run.
   
   Also worth knowing: two arms look winnable and should be left alone. 
`isLastBatch = nextLowerBound >= upperBound` on both the LONG and DOUBLE arms 
can be flipped to `>` and survive — the only distinguishing input makes 
production emit a **duplicate final window**, so a killing test would cement 
that defect.
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to