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

    https://github.com/apache/spark/pull/14733#discussion_r77259926
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala
 ---
    @@ -98,9 +100,14 @@ case class InMemoryRelation(
         buildBuffers()
       }
     
    -  def recache(): Unit = {
    -    _cachedColumnBuffers.unpersist()
    +  def unpersist(blocking: Boolean = true): Unit = {
    +    batchStats.reset()
    --- End diff --
    
    To clarify, is this because the content of the batches might change after 
recomputation in such a way that the use of these batch stats for whole 
partition pruning would be invalid? It's my understanding that the _set_ of 
values in each RDD partition will be the same although their order within that 
partition may change unless a sort is performed (this is the case for reduce 
tasks due to interleaving of fetched map output, for example).
    
    Given this, it seems like the correctness case that we'd have to worry 
about is a situation where the old batch stats would have pruned a partition 
but that pruning decision is invalid with the new stats. But I'm not sure how 
that can be the case given that pruning decisions seem to be based on 
conditions defined over the maximum or minimum values of columns and we're 
effectively constructing partition-wide stats by `AND`-ing conditions over the 
per-batch stats.
    
    Basically, I think that I see the motivation for this but I don't have an 
immediate counterexample to show how things would break if we omitted this.


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