Skip to content

Instantly share code, notes, and snippets.

Verve Group Engineering challenge (brief)

Business Model

Advertisement banners are displayed to users in a mobile application (app_id) in a country (country code) from an advertiser (advertiser_id). When this happens, an impression event is recorded and stored. Optionally, if the user clicks on the banner, a click event is recorded.

Input

Arguments

import org.apache.spark.sql.types.SQLUserDefinedType
@SQLUserDefinedType(udt = classOf[ElementWithCountUDT])
case class ElementWithCount(element:String, count:Int) extends Serializable {
override def toString: String = {
Seq(
element,
count