Created
September 6, 2018 10:22
-
-
Save brabster/dcd6e357423a29b65694b9383d39d20a to your computer and use it in GitHub Desktop.
Scala Types in Scio Pipelines - 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object AccessLog { | |
case class Entry(clientIp: String, userId: String, timestamp: Instant, path: String, statusCode: Int) | |
def parseLine(line: String): Entry = line.split(",") match { | |
case Array(clientIp, userId, timestamp, path, statusCode) => | |
Entry(clientIp, userId, new Instant(timestamp), path, statusCode.toInt) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment