zhengruifeng opened a new pull request, #637: URL: https://github.com/apache/spark-connect-rust/pull/637
### What changes were proposed in this pull request? Implement the two remaining native clustering algorithms from PySpark 4.3.0 in the Rust API and Python bindings: - `LDA`: online and EM training, all 14 constructor parameters with setters, and cached-model DataFrame transforms. - `PowerIterationClustering`: all six parameters and `assign_clusters` / `assignClusters`, using Spark Connect's `powerIterationClusteringAssignClusters` helper. The lazy result retains any cached models used by its input. Add official PySpark parameter, helper-request and inference fixtures, Rust/Python tests, CI integration, and compatibility documentation. ### Why are the changes needed? KMeans, BisectingKMeans and GaussianMixture already have native implementations. Adding LDA and PowerIterationClustering completes execution support for all five clustering algorithms in standard `pyspark.ml.clustering`. ### Does this PR introduce _any_ user-facing change? Yes. Rust exposes `ml::LDA`, `ml::LDAModel` and `ml::PowerIterationClustering`. Python exposes the two algorithms through `pyspark.ml.connect.clustering` and `pyspark.ml.connect`. All methods require Spark DataFrames; pandas inputs are rejected consistently. LDA returns the shared native `MLModel`; PIC returns an `id: bigint, cluster: int` DataFrame and has no fit/transform API. This completes algorithm execution coverage. Rich LDA model inspection, likelihood/perplexity methods, topic descriptions, model conversion and persistence remain outside this native surface, as documented. ### How was this patch tested? - 28 new native Python live tests passed against Spark 4.3.0; 26 shared cases also passed with official PySpark. Two native-only cases cover numeric-array features and retaining a cached input model after garbage collection. The latter raises `CONNECT_ML.CACHE_INVALID` with the official PIC helper; the native relation retains the input owner. - All 190 existing Python ML live tests passed, including the other clustering algorithms. - 3,688 Python offline/Arrow handoff tests passed (8 skipped), including 315 ML tests and new signature, parameter-conversion, pandas-rejection and helper-request checks. - 682 Rust unit tests passed, plus new clustering protocol/live tests and existing clustering integration tests. All integration tests compiled with and without `wasm-udf`; rustfmt, workspace Clippy with `-D warnings`, and Ruff passed. - API introspection found all five clustering algorithms exposed natively, and zero Connect-only SQL API gaps after the documented transport-only exclusions. - Official Spark 4.3.0 Connect suite through the Rust transport: 2,638 passed, 589 skipped across 87 files with zero unexpected failures. Three artifact/local-cluster test files requiring a separate cluster environment were excluded. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-6) This pull request and its description were written by Isaac. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
