com.datawizards.dqm.rules.field.DictionaryRule.scala Maven / Gradle / Ivy
package com.datawizards.dqm.rules.field
import org.apache.spark.sql.Row
case class DictionaryRule(values: Seq[String]) extends FieldRule with AnyTypeComparator {
override def name: String = "DICT"
override def validate(field: String, row: Row): Boolean = {
val value = row.getAs[Any](field).toString
values.contains(value)
}
}