shangxinli commented on code in PR #18405:
URL: https://github.com/apache/hudi/pull/18405#discussion_r3052992154
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/utils/SparkValidatorUtils.java:
##########
@@ -84,6 +84,22 @@ public static void runValidators(HoodieWriteConfig config,
Dataset<Row> beforeState = getRecordsFromCommittedFiles(sqlContext,
partitionsModified, table, afterState.schema());
Stream<SparkPreCommitValidator> validators =
Arrays.stream(config.getPreCommitValidators().split(","))
+ .map(String::trim)
+ .filter(s -> !s.isEmpty())
+ .filter(validatorClass -> {
+ try {
+ Class<?> clazz = Class.forName(validatorClass);
+ if (!SparkPreCommitValidator.class.isAssignableFrom(clazz)) {
+ LOG.warn("Skipping validator {} — it does not implement
SparkPreCommitValidator. "
+ + "If this is a streaming offset validator (e.g.
SparkKafkaOffsetValidator), "
+ + "it will be invoked by SparkStreamerValidatorUtils
instead.", validatorClass);
+ return false;
+ }
+ return true;
+ } catch (ClassNotFoundException e) {
+ throw new HoodieValidationException("Cannot find validator
class: " + validatorClass, e);
+ }
+ })
Review Comment:
Fixed
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]