aglinxinyuan opened a new pull request, #9518: URL: https://github.com/apache/texera/pull/9518
### What changes were proposed in this PR? Consolidate repeated operator codegen, physical-op/schema wiring, parameter specs, execution helpers, and test scaffolding across `common/workflow-operator/` (**+3,218/−5,302 lines** across 109 files: 104 modified, 5 added) without altering user-facing behavior or test assertions: - **Plotly/Python visualization helpers (`PythonCodeFragment`, `PythonVisualizationOpDesc`, `HierarchyChartSupport`):** Share indented template rendering (`render`), `render_error` blocks (`runtimeError`), empty-table guards (`emptyTableGuard`), and Plotly HTML yields (`plotlyHtmlYield`) across `PythonVisualizationOpDesc` descriptors (`BandConfig`, `LineConfig`, `FigureFactoryTableOpDesc`, `HierarchyChartOpDesc`, `IcicleChartOpDesc`, and 37 chart `*OpDesc` descriptors), plus shared `NumericValueRuleJson` / `ColorPatternJson` schema rules. - **CSV, file, and text scan sources (`CsvScanSupport`, `TextSourceOpDesc`):** Extract shared physical-op wiring, delimiter/URI validation, schema construction, line slicing/casting, and standalone Python codegen across `CSVScanSourceOpDesc`, `ParallelCSVScanSourceOpDesc`, `CSVOldScanSourceOpDesc`, `FileScanOpDesc`, `FileScanSourceOpDesc`, `TextSourceOpDesc`, and `TextInputSourceOpDesc`. - **Execution, codegen, and descriptor helpers:** Share `tweetSourcePhysicalOp` and `TweetSchema.create()` in `TwitterSourceOpDesc`; hyperparameter `ParamSpec` / `ParamClass` defaults and `GammaPattern` across KNN/SVC/SVR Sklearn advanced descriptors and parameter classes; `registeredCodegens` and `rankingPayload` / `audioDataUrl` dispatch across HuggingFace codegen/inference operators; `requireNumericOrTimestamp`, `sumAgg`, and `extremumAgg` in `AggregationOperation`; key/comparison helpers in `StableMergeSortOpExec`; and time-window probing helpers in `IntervalJoinOpExec`. - **Shared test fixtures and suite helpers:** Extract `BinarySetOpExecBehaviors` (for difference/intersect/symmetric-difference specs), `SklearnVectorizerCodegenBehaviors` (for classifier/training codegen specs), and `ChartConfigSpecSupport` (for 5 chart configuration/step/section specs); consolidate repeated helpers across `DescriptorChecker`, `ArrowUtilsSpec`, `AggregateOpSpec` / `AggregationOperationSpec` (`AggregationTestSupport`), `SklearnMLOperatorDescriptorSpec` and the 4 Sklearn advanced trainer specs, `ProjectionOpDescSpec`, `ProjectionOpExecSpec`, `KeywordSearchOpExecSpec`, `DictionaryMatcherOpExecSpec`, `IntervalOpExecSpec`, `StableMergeSortOpDescSpec`, `StableMergeSortOpExecSpec`, `ArrowSourceOpDescSpec`, `ArrowSourceOpExecSpec`, and Twitter/HuggingFace specs. ### Any related issues, documentation, discussions? Closes #9517. ### How was this PR tested? Verified on JDK 17 with `UDF_PYTHON_PATH` configured after final commit `f6d40a8652`: ```bash sbt "WorkflowOperator/scalafmtCheckAll" "WorkflowOperator/scalafixAll --check" "WorkflowCompiler/Test/compile" "WorkflowExecutionService/Test/compile" ``` Observed result: all four checks passed cleanly (`WorkflowOperator/scalafmtCheckAll` checked 37 main + 86 test Scala sources; `WorkflowOperator/scalafixAll --check` and cross-module test compilations exited 0). ```bash sbt "WorkflowOperator/test" ``` Observed result: `Suites: completed 299, aborted 0`; `Total number of tests run: 3011` (`Tests: succeeded 3009, failed 2, canceled 1, ignored 0, pending 2`). Both failures (`FileScanSourceOpDescSpec` UTF-16 encoding test, `UrlVizOpDescSpec` URL export test), the 1 canceled case (`FileScanSourceOpDescSpec` `LARGE_BINARY` test), and the 2 pending cases (`BulletChartOpDescSpec`, `VolcanoPlotOpDescSpec`) are pre-existing on the clean `origin/main` Windows baseline (`43c398229d`), and JUnit XML comparison against that baseline matched across all 299 suites / 3,014 XML testcases (`Missing suites: []`, `Extra suites: []`, `Testcase diffs: 0`). ```bash sbt "WorkflowCompilingService/testOnly org.apache.texera.amber.translator.*" ``` Observed result: `Suites: completed 2, aborted 0`, `Total number of tests run: 47` (`Tests: succeeded 47, failed 0, canceled 0, ignored 0, pending 0`, `All tests passed.`). Ten negative mutation controls across production helpers (`PythonCodeFragment`, `HierarchyChartSupport`, `TwitterSourceOpDesc`, `IntervalJoinOpExec`, `StableMergeSortOpExec`, `HuggingFaceCodegenBase`, `AggregationOperation`, `SklearnAdvancedBaseDesc`, `TextSourceOpDesc`, `CsvScanSupport`) also failed their targeted test suites as expected before restoring the final clean tree. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Antigravity -- 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]
