ai.chronon.spark.Args.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spark_embedded_2.11 Show documentation
Show all versions of spark_embedded_2.11 Show documentation
Chronon is a feature engineering platform
package ai.chronon.spark
import ai.chronon.api.ThriftJsonCodec
import org.apache.thrift.TBase
import org.rogach.scallop._
import scala.reflect.ClassTag
class Args(args: Seq[String]) extends ScallopConf(args) {
val confPath: ScallopOption[String] = opt[String](required = true)
val endDate: ScallopOption[String] = opt[String](required = false)
val stepDays: ScallopOption[Int] = opt[Int](required = false) // doesn't apply to uploads
val skipEqualCheck: ScallopOption[Boolean] =
opt[Boolean](required = false, default = Some(false)) // only applies to join job for versioning
def parseConf[T <: TBase[_, _]: Manifest: ClassTag]: T =
ThriftJsonCodec.fromJsonFile[T](confPath(), check = true)
override def toString(): String = {
s"""
|confPath = $confPath
|endDate = $endDate
|stepDays = $stepDays
|skipEqualCheck = $skipEqualCheck""".stripMargin
}
}