zhengruifeng opened a new pull request, #647: URL: https://github.com/apache/spark-connect-rust/pull/647
### What changes were proposed in this pull request? Add native Rust `ALS`/`ALSModel`, PyO3 bindings, and exports from `pyspark.ml.connect.recommendation` and `pyspark.ml.connect`. Support all 18 estimator parameters, explicit/implicit feedback, nonnegative factors, fit/transform, rank, user/item factor tables, and all four recommendation APIs. Lazy factor/recommendation results retain their cached model and any models used by the subset DataFrame. ### Why are the changes needed? The native client has no recommendation estimator. This adds standard Spark ML ALS over Connect, with reference-backed parameter encoding and numerical tests against official PySpark 4.3.0. It is based on master after the FPGrowth/PrefixSpan merge and preserves those algorithms' CI coverage. ### Does this PR introduce _any_ user-facing change? Yes. Rust and Rust-backed Python users can train recommenders, inspect factors, predict ratings and generate recommendations. Python mirrors the 17 official constructor keywords; `predictionCol` is set with `setPredictionCol`, and `setNumBlocks` sets both block counts. Model transform setters include cold-start handling. Factor/recommendation methods query the fitted server model, matching official Connect behavior. Fit, transform and subset recommendation arguments require Spark DataFrames. Pandas inputs are rejected before conversion/RPC, and model operations reject DataFrames from another session. Vendored `pyspark.ml.recommendation` is unchanged. Native model persistence remains separate work. ### How was this patch tested? - Official PySpark 4.3.0 fixtures cover parameter protobufs and integer widths, explicit and implicit/nonnegative feedback, held-out predictions, cold starts, factors, all-user/all-item recommendations, and subset recommendations including duplicate/unknown IDs. - Full offline Python suite: 4245 passed, 8 skipped, 14 subtests passed. Native live ML suite, including feature stages and frequent patterns: 169 passed. Official-reference ALS live tests: 10 passed, 1 skipped. - Rust: 2 parameter golden tests, 3 live ALS tests, and 682 library tests passed. All integration tests compile with and without `wasm-udf`; workspace formatting, Clippy with warnings denied, and release extension build passed. - The live tests cover schema/numerical parity, model setter snapshots, invalid parameters and fractional IDs, session mismatches, and lazy model/input lifetime. - Official Connect regression gate: all 87 selected files passed, 2,638 tests passed and 589 skipped. The three existing artifact/local-cluster exclusions were retained. Client and worker Python versions were aligned to 3.13. - Public SQL API comparison found zero gaps after the two documented transport exclusions; Ruff lint and format checks passed. ### 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]
