File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
sql/core/src/main/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,8 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
131131 if canBeCodeGened(
132132 allAggregates(partialComputation) ++
133133 allAggregates(rewrittenAggregateExpressions)) &&
134- codegenEnabled =>
134+ codegenEnabled => {
135+ if (self.sqlContext.getConf(" spark.sql.unsafe.enabled" , " false" ) == " true" ) {
135136 execution.UnsafeGeneratedAggregate (
136137 partial = false ,
137138 namedGroupingAttributes,
@@ -141,6 +142,18 @@ private[sql] abstract class SparkStrategies extends QueryPlanner[SparkPlan] {
141142 groupingExpressions,
142143 partialComputation,
143144 planLater(child))) :: Nil
145+ } else {
146+ execution.GeneratedAggregate (
147+ partial = false ,
148+ namedGroupingAttributes,
149+ rewrittenAggregateExpressions,
150+ execution.GeneratedAggregate (
151+ partial = true ,
152+ groupingExpressions,
153+ partialComputation,
154+ planLater(child))) :: Nil
155+ }
156+ }
144157
145158 // Cases where some aggregate can not be codegened
146159 case PartialAggregation (
You can’t perform that action at this time.
0 commit comments