aglinxinyuan opened a new pull request, #9683:
URL: https://github.com/apache/texera/pull/9683
### What changes were proposed in this PR?
Fourteen operator specs in `workflow-operator` repeated their fixtures case
by case. Each spec family now shares them:
- **SQL sources.** `MySQLSourceOpExecSpec` and `PostgreSQLSourceOpExecSpec`
register their seventeen cases once, through `registerDialectBehaviors` in
`JdbcSourceOpExecTestHarness`. A `DialectBehavior` holds each dialect's URL,
clause and keyword, and the wording its own case names used. The harness also
builds the descriptors and executors that both specs built themselves.
`AsterixDBSourceOpExecSpec` sets its keyword, regex, geo and predicate filters
through four builders, and its batch literals through two.
- **Aggregate and extract datetime.** Both specs find Python through
`PythonTestSupport` instead of their own copies, and extract datetime runs its
export through `runSource`. A hung interpreter there now fails at the same 180
s instead of blocking the run. `AggregateOpDescSpec` runs its executor through
`runAggregateExec`, builds its three timestamp drivers through
`assertTimestampSumAvg`, and sets the time zone through `runWithTimeZone`.
- **Sklearn registry and stable merge sort.** `SklearnOpDescRegistrySpec`
pairs each classifier with its trainer in one table and registers the wiring
and coverage checks for both through shared helpers.
`StableMergeSortOpExecSpec` opens and closes its executor through
`withOpenExec` and builds its inputs through small builders. Each case still
reads its values with its own type.
- **Search and set operations.** The regex and substring-search specs share
`FilterSearchSpecSupport`, which holds the match assertions, the physical-op
check and the Python parity harness. The three set-operation specs share their
two parity checks through `SetRows`.
Every test keeps its name, its inputs and its expected values. The paired
sklearn table runs the Decision Tree and Dummy Classifier training cases in the
classifier table's order, so those four cases swap places. Only test code
changes.
### Any related issues, documentation, discussions?
Closes #9682.
### How was this PR tested?
- The 14 changed suites, with `UDF_PYTHON_PATH` set to a Python that has
pandas: the 327 tests pass on main and on this branch, with the same names,
compared case by case from the JUnit XML reports. None was cancelled, and every
suite keeps its order apart from the four sklearn cases above.
```
sbt "WorkflowOperator/testOnly
org.apache.texera.amber.operator.sklearn.SklearnOpDescRegistrySpec
org.apache.texera.amber.operator.sort.StableMergeSortOpExecSpec
org.apache.texera.amber.operator.source.sql.mysql.MySQLSourceOpExecSpec
org.apache.texera.amber.operator.source.sql.postgresql.PostgreSQLSourceOpExecSpec
org.apache.texera.amber.operator.source.sql.asterixdb.AsterixDBSourceOpExecSpec
org.apache.texera.amber.operator.aggregate.AggregateOpDescSpec
org.apache.texera.amber.operator.extractdatetime.ExtractDateTimeOpDescSpec
org.apache.texera.amber.operator.regex.RegexOpDescSpec
org.apache.texera.amber.operator.regex.RegexOpExecSpec
org.apache.texera.amber.operator.substringSearch.SubstringSearchOpDescSpec
org.apache.texera.amber.operator.substringSearch.SubstringSearchOpExecSpec
org.apache.texera.amber.operator.set.difference.DifferenceOpDescSpec
org.apache.texera.amber.operator.set.intersect.IntersectOpDescSpec
org.apache.texera.amber.operator.set.symmetricDifference.Symmet
ricDifferenceOpDescSpec"
```
- Mutation check: breaking one shared helper in each family fails 102 of the
327 tests, with failures in every one of the 14 suites. The breaks were keyword
search flipped in the JDBC harness and the AsterixDB builders,
`runAggregateExec` fed one tuple, `allFields` without SECOND, the sklearn name
check, `sortColumn` reversed, the match and physical-op checks in
`FilterSearchSpecSupport`, and the `SetRows` inputs.
- `sbt "WorkflowOperator/scalafmtCheck"
"WorkflowOperator/Test/scalafmtCheck" "WorkflowOperator/scalafix --check"
"WorkflowOperator/Test/scalafix --check"`
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Antigravity (Gemini) and Claude Code (Claude Opus 5.5)
--
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]