cloud-fan commented on a change in pull request #33624:
URL: https://github.com/apache/spark/pull/33624#discussion_r682333863
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala
##########
@@ -65,7 +65,8 @@ case class AdaptiveSparkPlanExec(
inputPlan: SparkPlan,
@transient context: AdaptiveExecutionContext,
@transient preprocessingRules: Seq[Rule[SparkPlan]],
- @transient isSubquery: Boolean)
+ @transient isSubquery: Boolean,
+ @transient outputColumnar: Boolean = false)
Review comment:
For example:
```
case class WriteToParquetColumnarExec(input: SparkPlan, ...) extends
UnaryExecNode {
def doExecute... = {
val finalPlan = input match {
case a: AdaptiveSparkPlanExec => a.copy(outputColumnar = true)
case _ => input
}
finalPlan.executeColumnar().mapPartitions ...
}
}
```
Another idea is to add custom physical rules. Currently, we don't have an
extension point to allow people to add custom physical rules (that deal with
the physical plan produced by the planner). One workaround is to leverage
`ColumnarRule.postColumnarTransitions`:
```
class MyColumnarRule... {
def postColumnarTransitions = new Rule[SparkPlan] {
def apply(input: SparkPlan) = input match {
case w @ WriteToParquetColumnarExec(a: AdaptiveSparkPlanExec, ...) =>
w.copy(input = a.copy(outputColumnar = true))
case other => other
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]