Github user jimfcarroll commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5669#discussion_r28995720
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/tree/GradientBoostedTrees.scala ---
    @@ -177,102 +177,108 @@ object GradientBoostedTrees extends Logging {
         treeStrategy.assertValid()
     
         // Cache input
    -    if (input.getStorageLevel == StorageLevel.NONE) {
    +    val persistedInput = if (input.getStorageLevel == StorageLevel.NONE) {
           input.persist(StorageLevel.MEMORY_AND_DISK)
    -    }
    +      true
    +    } else false
     
    -    timer.stop("init")
    +    try {
    --- End diff --
    
    I override and intercept most RDD calls in my own code to optimize them 
(which is how I found this in the first place) and we use try-with-resource to 
persist and unpersist. It's too bad you cant do that simply in scala.
    
    If you want the simpler solution let me know. I can change it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to