uros-b opened a new pull request, #57928:
URL: https://github.com/apache/spark/pull/57928

   ### What changes were proposed in this pull request?
   
   Removes members with no callers from the two decision tree `Node` files.
   
   `mllib/tree/model/Node.scala`: `deepCopy`, and the companion helpers 
`isLeftChild`, `maxNodesInLevel`, `startIndexInLevel`, `emptyNode`, 
`parentIndex`, `getNode`, `indexToLevel`.
   
   `ml/tree/Node.scala`: the `deepCopy` declaration and its two overrides, plus 
`parentIndex`, `isLeftChild`, `maxNodesInLevel`, `startIndexInLevel`, `getNode`.
   
   ### Why are the changes needed?
   
   None of these has a caller. `deepCopy` is reachable only from itself, so the 
declaration and both overrides are dead as a unit. The last callers of the 
indexing helpers disappeared when the decision tree implementation moved from 
`spark.mllib` to `spark.ml`.
   
   Both files are covered because `ml/tree/Node.scala` carries the comment `// 
The below indexing methods were copied from spark.mllib.tree.model.Node`, so 
removing only the original would leave the labelled copy behind.
   
   The live members are kept: `apply`, `leftChildIndex` and `rightChildIndex` 
in both objects, plus `emptyNode` and `indexToLevel` in `LearningNode`, which 
`RandomForest` still calls.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. The `mllib` companion object is `private[spark]` and `deepCopy` is 
`private[tree]`, so nothing removed is public API. `GenerateMIMAIgnore` already 
excludes package-private members, so no `MimaExcludes` entry is required.
   
   ### How was this patch tested?
   
   Pure removal of unreferenced code; no test references any removed member. 
Deadness was checked for each name across all file types, and dynamic 
reachability was ruled out explicitly: none appears as a string literal, there 
is no reflection or codegen in either tree package, and no MiMa filter names 
them. The two `Node` hierarchies are unrelated (`ml` imports the `mllib` one 
under an alias), so removing from one cannot affect the other.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)
   


-- 
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]

Reply via email to