We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce782c0 commit 311ec69Copy full SHA for 311ec69
src/main/scala/com/cloudera/sa/examples/tablestats/model/FirstPassStatsModel.scala
@@ -13,12 +13,12 @@ class FirstPassStatsModel extends Serializable {
13
}
14
15
def +=(firstPassStatsModel: FirstPassStatsModel): Unit = {
16
- firstPassStatsModel.columnStatsMap.foreach{ e =>
17
- val columnStats = columnStatsMap.getOrElse(e._1, null)
18
- if (columnStats != null) {
19
- columnStats += e._2
20
- } else {
21
- columnStatsMap += ((e._1, e._2))
+ firstPassStatsModel.columnStatsMap.foreach{ case(idx, stats) =>
+ columnStatsMap.get(idx) match {
+ case Some(prevStats) =>
+ prevStats += stats
+ case None =>
+ columnStatsMap(idx) = stats
22
23
24
0 commit comments