You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by patrickhuang <re...@gmail.com> on 2016/10/28 01:30:37 UTC

Re: Need help Creating a rule using the Streaming API

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