Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GLUTEN-3854][CORE][FOLLOWUP] Add ColumnarInputAdapter back to recover UI graph #3933

Merged
merged 3 commits into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ import scala.collection.JavaConverters._
* would be transformed to `ValueStreamNode` at native side.
*/
case class InputIteratorTransformer(child: SparkPlan) extends UnaryTransformSupport {
// `InputAdapter` is a case class, so `ColumnarInputAdapter.withNewChildren()` will return
// `InputAdapter`.
assert(child.isInstanceOf[InputAdapter])

@transient
override lazy val metrics: Map[String, SQLMetric] =
Expand Down Expand Up @@ -66,6 +69,17 @@ case class InputIteratorTransformer(child: SparkPlan) extends UnaryTransformSupp
}
}

/**
* InputAdapter is used to hide a SparkPlan from a subtree that supports transform. Note, if we
* remove this adaptor, the SQL UI graph would be broken.
*/
class ColumnarInputAdapter(child: SparkPlan) extends InputAdapter(child) {
// this is the most important effect of this class
override def supportCodegen: Boolean = false

override def nodeName: String = s"InputAdapter"
}

/**
* Implemented by referring to spark's CollapseCodegenStages.
*
Expand Down Expand Up @@ -153,6 +167,6 @@ object ColumnarCollapseTransformStages {
val transformStageCounter = new AtomicInteger(0)

def wrapInputIteratorTransformer(plan: SparkPlan): TransformSupport = {
InputIteratorTransformer(plan)
InputIteratorTransformer(new ColumnarInputAdapter(plan))
}
}
Loading