Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2021 11:35
What would you like to do?
case class DeviceIoTData (
battery_level: Long,
c02_level: Long,
cca2: String,
cca3: String,
cn: String,
device_id: Long,
device_name: String,
humidity: Long,
ip: String,
latitude: Double,
lcd: String,
longitude: Double,
temp: Long,
timestamp: Long)
val ds =[DeviceIoTData]
val dsAvgTmp = ds
.filter(d => {d.temp > 25})
.map(d => (d.temp, d.humidity, d.cca3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment