Skip to content

Instantly share code, notes, and snippets.

@blvp
Last active May 16, 2018 11:56
Show Gist options
  • Save blvp/b6b51d41d91b6b3a5c91c23e0cb7958c to your computer and use it in GitHub Desktop.
Save blvp/b6b51d41d91b6b3a5c91c23e0cb7958c to your computer and use it in GitHub Desktop.
object PcaLvmOutput extends MistFn {
implicit val resultMessageEnc = mist.api.encoding.generic.encoder[ResultMessage]
override def handle: Handle = {
withArgs(
arg[String]("table_prefix"),
arg[Int]("nod_histogram_length", 31)
.validated(nodHistogramLength => nodHistogramLength > 0, "nod_histogram_length value should be positive"),
arg[Int]("limit_value", 250),
arg[String]("sources", " 'ai_6010' "),
arg[Int]("scaling_factor_days_processed", 90),
arg[Int]("cross_device_level", 2),
arg[String]("date_end"),
arg[String]("ref_table_url", "jdbc:mysql://proddb-21.jiwiredev.com:3306/pca_ref"),
arg[String]("ref_table_user", "pca_ro"),
arg[Seq[String]]("views", Seq(
"Time to 1st Visit histogram",
"LCI Visits by Dimensions",
"LCI visit metrics by All",
"LCI by store",
"LCI by DMA",
"LCI by All")))
.withMistExtras
.onSparkContext((tablePrefix: String,
nodHistogramLength: Int,
limit: Int,
sources: String,
scalingFactorDaysProcessed: Int,
crossDeviceLevel: Int,
dateEnd: String,
refTableUrl: String,
refTableUser: String,
views: Seq[String],
extras: MistExtras,
sc: SparkContext) => {
val result: ResultMessage = ???
result
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment