diff --git a/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/action/QueriesCompare.scala b/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/action/QueriesCompare.scala index c79db83c7b24..596c293e473e 100644 --- a/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/action/QueriesCompare.scala +++ b/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/action/QueriesCompare.scala @@ -135,16 +135,15 @@ object QueriesCompare { } private def printResults(results: List[TestResultLine]): Unit = { - val render = TableRender.plain[TestResultLine]( - "Query ID", - "Was Passed", - "Vanilla Row Count", - "Gluten Row Count", - "Vanilla Planning Time (Millis)", - "Gluten Planning Time (Millis)", - "Vanilla Query Time (Millis)", - "Gluten Query Time (Millis)", - "Speedup") + import org.apache.gluten.integration.action.TableRender.Field._ + + val render = TableRender.create[TestResultLine]( + Leaf("Query ID"), + Leaf("Passed"), + Branch("Row Count", List(Leaf("Vanilla"), Leaf("Gluten"))), + Branch("Planning Time (Millis)", List(Leaf("Vanilla"), Leaf("Gluten"))), + Branch("Query Time (Millis)", List(Leaf("Vanilla"), Leaf("Gluten"))), + Leaf("Speedup")) results.foreach { line => render.appendRow(line) diff --git a/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/action/TableRender.scala b/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/action/TableRender.scala index d16ce784b2df..b26fdccdf2ab 100644 --- a/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/action/TableRender.scala +++ b/tools/gluten-it/common/src/main/scala/org/apache/gluten/integration/action/TableRender.scala @@ -164,6 +164,17 @@ object TableRender { } } + val separationLine = schema.leafs + .map { leaf => + widthMap(System.identityHashCode(leaf)) + } + .map { width => + new String(Array.tabulate(width)(_ => '-')) + } + .mkString("|", "|", "|") + + printer.println(separationLine) + data.foreach { row => val dataLine = row .zip(schema.leafs)