Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Last active January 27, 2021 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/fdac31b374024041672780f77bedf5d7 to your computer and use it in GitHub Desktop.
Save velotiotech/fdac31b374024041672780f77bedf5d7 to your computer and use it in GitHub Desktop.
val constraintResult = { ConstraintSuggestionRunner()
.onData(data)
.addConstraintRules(Rules.DEFAULT)
.run()
}
val suggestionsDF = constraintResult.constraintSuggestions.flatMap {
case (column, suggestions) =>
suggestions.map { constraint =>
(column, constraint.description, constraint.codeForConstraint)
}
}.toSeq.toDS()
suggestionsDF.select("_1","_2").show(false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment