LittleZhao commented on a change in pull request #538: [GRIFFIN-289]New feature
for griffin COMPLETENESS dq type
URL: https://github.com/apache/griffin/pull/538#discussion_r328460227
##########
File path:
measure/src/main/scala/org/apache/griffin/measure/configuration/dqdefinition/DQConfig.scala
##########
@@ -206,3 +211,23 @@ case class RuleOutputParam( @JsonProperty("type") private
val outputType: String
def validate(): Unit = {}
}
+
+/**
+ * error configuration parameter
+ * @param columnName the name of the column
+ * @param errorType the way to match error, regex or enumeration
+ * @param values error value list
+ */
+@JsonInclude(Include.NON_NULL)
+case class RuleErrorConfParam( @JsonProperty("column.name") private val
columnName: String,
+ @JsonProperty("type") private val errorType:
String,
+ @JsonProperty("values") private val values:
List[String]
+ ) extends Param {
+ def getColumnName: Option[String] = if (StringUtils.isNotBlank(columnName))
Some(columnName) else None
+ def getErrorType: Option[String] = if (StringUtils.isNotBlank(errorType))
Some(errorType) else None
+ def getValues: Seq[String] = if (values != null) values else Nil
+
+ def validate(): Unit = {
+ assert("regex".equals(getErrorType.get) ||
"enumeration".equals(getErrorType.get), "error error.conf type")
Review comment:
done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services