Github user srowen commented on the pull request:

    https://github.com/apache/spark/pull/5250#issuecomment-87688106
  
    You can use Spark to do this too, sure. Functions can call the HDFS API to 
check and delete files in parallel. Roughly:
    
    ```
    sc.parallelize(fs.listStatus(...).map(_.getPath.toString)).map { pathStr => 
      val path = new Path(pathStr)
      val in = new GZIPInputStream(fs.open(path))
      try {
        in.read()
      } catch {
        case e: ZipException => fs.delete(path, false)
      } finally {
        in.close()
      }
    }
    ```
    
    I'm sure that's not 100% right but you see the idea. 
    
    I am not proposing that this become a Spark API. It seems like an 
application-specific piece of logic that can be written using Spark. I don't 
claim Scala + Spark + Hadoop is easy, but it is directly doable with these 
tools.
    
    I think the point stands that this change does not help solve the problem 
directly, as the above does. It ignores the problem, which is sometimes a fine 
strategy, but at the cost of significant side effects. The side effects are the 
non-starter, to me. But the upside is I think there is a direct solution too.
    
    Well I've said enough so it's time to let others weigh in too.


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