Skip to content

Commit

Permalink
[KYUUBI-5780][FOLLOWUP] Format PermanentViewMarker tree string
Browse files Browse the repository at this point in the history
  • Loading branch information
AngersZhuuuu committed Nov 30, 2023
1 parent 19ae399 commit 6175e90
Showing 1 changed file with 27 additions and 0 deletions.
Expand Up @@ -24,4 +24,31 @@ import org.apache.spark.sql.catalyst.plans.logical.{LeafNode, LogicalPlan}
case class PermanentViewMarker(child: LogicalPlan, catalogTable: CatalogTable) extends LeafNode {

override def output: Seq[Attribute] = child.output

override def generateTreeString(
depth: Int,
lastChildren: Seq[Boolean],
append: String => Unit,
verbose: Boolean,
prefix: String,
addSuffix: Boolean,
maxFields: Int,
printNodeId: Boolean,
indent: Int): Unit = {
append(" " * indent)
if (depth > 0) {
lastChildren.init.foreach { isLast =>
append(if (isLast) " " else ": ")
}
append(if (lastChildren.last) "+- " else ":- ")
}

append(prefix)
append(s"$nodeName")
append("\n")

child.generateTreeString(
depth + 1, lastChildren :+ true, append, verbose, prefix,
addSuffix, maxFields, printNodeId = printNodeId, indent = indent)
}
}

0 comments on commit 6175e90

Please sign in to comment.