Commit e4f0b08233df63f091060adfc379574536de48d1
1 parent
60c7dbd340
Exists in
master
getLog def error filter
Showing 1 changed file with 9 additions and 3 deletions Side-by-side Diff
app/com/piki_ds/ver2ggh/expConTime.scala
View file @
e4f0b08
... | ... | @@ -79,9 +79,15 @@ |
79 | 79 | } |
80 | 80 | }).flatMap(x => x) |
81 | 81 | |
82 | - val df = action.filter(x => x.getOrElse("ERROR", null) == null).map { x => | |
83 | - (x("event"), x("time").toLong, x("uuid").toLong, x("cid").toLong, | |
84 | - x.getOrElse("fromKey", null), x.getOrElse("position", null), x.getOrElse("dwell", "0").toInt,x.getOrElse("consume", "0").toInt)} | |
82 | + val df = action.filter(x => x != None).filter(x => x.getOrElse("ERROR", null) == null).map { x => | |
83 | + try { | |
84 | + Some(x("event"), x("time").toLong, x("uuid").toLong, x("cid").toLong, | |
85 | + x.getOrElse("fromKey", null), x.getOrElse("position", null), x.getOrElse("dwell", "0").toInt, x.getOrElse("consume", "0").toInt) | |
86 | + } catch { | |
87 | + case e: Exception => | |
88 | + None | |
89 | + } | |
90 | + }.filter(x => x != None).map(x => x.get) | |
85 | 91 | |
86 | 92 | // 로그가 밀리는 현상이 발생 5/16일 기준 로그에서 5/16일 로그가 90.9% 5/15일 로그가 6.5% 를 차지하고 214개의 다른 날이 존재(오류포함)하기 때문에 기준일 t에 대한 데이터(91%)만 선택 |
87 | 93 | val df1 = df.toDF("event","time","uuid","cid","fromKey","position","dwell","consume").where("uuid != 0"). |