Skip to content
Snippets Groups Projects
Commit 19d3e1e8 authored by Cheng Lian's avatar Cheng Lian Committed by Michael Armbrust
Browse files

[SQL] Renamed ColumnStat to ColumnMetrics to avoid confusion between ColumnStats

Class names of these two are just too similar.

Author: Cheng Lian <lian.cs.zju@gmail.com>

Closes #2189 from liancheng/column-metrics and squashes the following commits:

8bb3b21 [Cheng Lian] Renamed ColumnStat to ColumnMetrics to avoid confusion between ColumnStats
parent 0cd91f66
No related branches found
No related tags found
No related merge requests found
......@@ -74,22 +74,22 @@ package object debug {
}
/**
* A collection of stats for each column of output.
* A collection of metrics for each column of output.
* @param elementTypes the actual runtime types for the output. Useful when there are bugs
* causing the wrong data to be projected.
*/
case class ColumnStat(
case class ColumnMetrics(
elementTypes: Accumulator[HashSet[String]] = sparkContext.accumulator(HashSet.empty))
val tupleCount = sparkContext.accumulator[Int](0)
val numColumns = child.output.size
val columnStats = Array.fill(child.output.size)(new ColumnStat())
val columnStats = Array.fill(child.output.size)(new ColumnMetrics())
def dumpStats(): Unit = {
println(s"== ${child.simpleString} ==")
println(s"Tuples output: ${tupleCount.value}")
child.output.zip(columnStats).foreach { case(attr, stat) =>
val actualDataTypes =stat.elementTypes.value.mkString("{", ",", "}")
child.output.zip(columnStats).foreach { case(attr, metric) =>
val actualDataTypes = metric.elementTypes.value.mkString("{", ",", "}")
println(s" ${attr.name} ${attr.dataType}: $actualDataTypes")
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment