You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/06/12 23:41:57 UTC
[I] add unit test coverage for AutoClosingIterator and UnionOpExec [texera]
aglinxinyuan opened a new issue, #5653:
URL: https://github.com/apache/texera/issues/5653
## Background
Two small helpers in `common/workflow-operator` currently lack a dedicated unit-spec:
| Source class | Package | Purpose |
| --- | --- | --- |
| `AutoClosingIterator` | `operator.source.scan` | Wraps an `Iterator[T]` with an `onClose: () => Unit` callback that fires exactly once when the underlying iterator reports `hasNext == false`. Used by scan sources to release input streams as soon as iteration ends. |
| `UnionOpExec` | `operator.union` | Trivial pass-through `OperatorExecutor`; `processTuple` yields the input tuple unchanged for every input port. |
## Behavior to pin
### `AutoClosingIterator`
| Surface | Contract |
| --- | --- |
| `hasNext` on a non-empty underlying iterator | returns `true`; `onClose` is NOT invoked |
| `hasNext` on an exhausted underlying iterator | returns `false`; `onClose` IS invoked exactly once |
| Repeated `hasNext` after exhaustion | does NOT invoke `onClose` again (`alreadyClosed` guard) |
| `next()` | delegates straight to the wrapped iterator |
| Full traversal via `toList` | yields every element of the wrapped iterator in order; `onClose` fires once when the loop sees `hasNext == false` |
| Iterator constructed over an already-empty source | first `hasNext` call returns `false` and fires `onClose` |
| `onClose` exceptions | propagate to the caller of `hasNext` (no swallowing) |
### `UnionOpExec`
| Surface | Contract |
| --- | --- |
| `processTuple(tuple, port = 0)` | yields a single-element `Iterator` containing the input tuple |
| `processTuple(tuple, port = N)` | yields the same tuple regardless of input port id |
| Repeated invocations | each call returns its own fresh iterator (no state leakage) |
| `null` tuple | propagates `null` through the iterator (pass-through is unconditional) |
## Scope
- New spec files (one per source class):
- `AutoClosingIteratorSpec.scala`
- `UnionOpExecSpec.scala`
- No production-code changes.
--
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: notifications-unsubscribe@texera.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] add unit test coverage for AutoClosingIterator and UnionOpExec [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #5653:
URL: https://github.com/apache/texera/issues/5653#issuecomment-4696561213
<!-- texera:template-compliance -->
👋 Thanks for opening this issue, @aglinxinyuan!
It looks like the issue description doesn't quite follow our template yet:
- This issue doesn't appear to use one of our templates (Bug, Feature, or Task). Please open it using a template so the required details are captured.
Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.
You can find the template prompts by editing the description, or see [CONTRIBUTING.md](https://github.com/apache/texera/blob/main/CONTRIBUTING.md) for the full contribution flow.
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] add unit test coverage for AutoClosingIterator and UnionOpExec [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan closed issue #5653: add unit test coverage for AutoClosingIterator and UnionOpExec
URL: https://github.com/apache/texera/issues/5653
--
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: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org