Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/4336#discussion_r24053791
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrameImpl.scala 
---
    @@ -260,11 +260,11 @@ private[sql] class DataFrameImpl protected[sql](
     
       override def take(n: Int): Array[Row] = head(n)
     
    -  override def collect(): Array[Row] = 
queryExecution.executedPlan.executeCollect()
    +  override def collect(): Array[Row] = rdd.collect()
     
       override def collectAsList(): java.util.List[Row] = 
java.util.Arrays.asList(rdd.collect() :_*)
     
    -  override def count(): Long = 
groupBy().count().rdd.collect().head.getLong(0)
    +  override def count(): Long = rdd.count()
    --- End diff --
    
    Oh? If I understand correctly, I think the rdd.count() is the most 
optimized (partial aggregation is done in before shuffling). @rxin , can you 
confirm that? Sorry If I am wrong.



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