spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patrickhuang <reduceby...@gmail.com>
Subject Re: Need help Creating a rule using the Streaming API
Date Fri, 28 Oct 2016 01:30:37 GMT
Hi,
Maybe you can try like this?
val transformed= events.map(event => ((event.user, event.ip),
1).reduceByKey(_ +_)
val alarm= transformed.filter(transformed._2 >= 10)

Patrick




--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Need-help-Creating-a-rule-using-the-Streaming-API-tp27954p27974.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


Mime
View raw message