Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
zhztheplayer committed May 29, 2024
1 parent adce788 commit ec57faa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ec57faa

Please sign in to comment.