zoukankan      html  css  js  c++  java
  • Eliminates these repeated computation in multi aggregations query

    https://github.com/pingcap/tispark/commit/dcca23bfa1aa0c356a4280d82bc8301c0de08318

    scala> spark.sql ("select count(number),avg(number) from person").explain
    == Physical Plan ==
    *HashAggregate(keys=[], functions=[sum(count(number#0L)#42L), sum(sum(number#0L)#43L), sum(count(number#0L)#45L)])
    +- Exchange SinglePartition
       +- *HashAggregate(keys=[], functions=[partial_sum(count(number#0L)#42L), partial_sum(sum(number#0L)#43L), partial_sum(count(number#0L)#45L)])
          +- Scan CoprocessorRDD[count(number#0L)#42L,sum(number#0L)#43L,count(number#0L)#45L]
      
    	  
    
    	  
    scala> spark.sql ("select count(number),avg(number) from person").explain()
    == Physical Plan ==
    *HashAggregate(keys=[], functions=[sum(count(number#0L)#20L), sum(sum(number#0L)#21L), sum(count(number#0L)#20L)])
    +- Exchange SinglePartition
       +- *HashAggregate(keys=[], functions=[partial_sum(count(number#0L)#20L), partial_sum(sum(number#0L)#21L), partial_sum(count(number#0L)#20L)])
          +- Scan CoprocessorRDD[count(number#0L)#20L,sum(number#0L)#21L]
    	  
    

      

  • 相关阅读:
    文件处理--文件操作
    三元运算
    alex 推荐的书
    python字符串、列表和字典的说明
    运算符
    while else语句
    格式化输出
    数据类型-元组
    数据类型-集合
    字符串
  • 原文地址:https://www.cnblogs.com/rsapaper/p/7756634.html
Copyright © 2011-2022 走看看