Last active
July 20, 2023 16:54
-
-
Save nfarah86/a448eec50d2b394932c2bcdf6349e53a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.hudi.client.validator.SparkPreCommitValidator | |
import org.apache.spark.sql.Dataset | |
import org.apache.spark.sql.Row | |
class CustomPreCommitValidator extends SparkPreCommitValidator { | |
override def validateRecordsBeforeAndAfter(before: Dataset[Row], | |
after: Dataset[Row], partitionsAffected: Set[String]): Unit = { | |
// Custom validation logic | |
// Perform data quality checks, apply business rules, etc. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment