lokeshj1703 commented on code in PR #7982: URL: https://github.com/apache/hudi/pull/7982#discussion_r1111811803
########## hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/QuarantineEvent.java: ########## @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.hudi.utilities.deltastreamer; + +import org.apache.avro.generic.GenericRecord; +import org.apache.spark.sql.types.DataType; + +public abstract class QuarantineEvent<T> { + + QuarantineReason reason; + T payload; + + public abstract DataType getPayloadType(); + + public abstract String getPayload(); + + public QuarantineReason getReason() { + return reason; + } + + public abstract GenericRecord getAvroPayload(); Review Comment: Addressed in latest commit. ########## hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/QuarantineEvent.java: ########## @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.hudi.utilities.deltastreamer; + +import org.apache.avro.generic.GenericRecord; +import org.apache.spark.sql.types.DataType; + +public abstract class QuarantineEvent<T> { + + QuarantineReason reason; + T payload; + + public abstract DataType getPayloadType(); Review Comment: Addressed in latest commit. ########## hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/SourceFormatAdapter.java: ########## @@ -100,7 +155,9 @@ public InputBatch<JavaRDD<GenericRecord>> fetchNewDataInAvroFormat(Option<String public InputBatch<Dataset<Row>> fetchNewDataInRowFormat(Option<String> lastCkptStr, long sourceLimit) { switch (source.getSourceType()) { case ROW: - return ((Source<Dataset<Row>>) source).fetchNext(lastCkptStr, sourceLimit); + InputBatch<Dataset<Row>> datasetInputBatch = ((Source<Dataset<Row>>) source).fetchNext(lastCkptStr, sourceLimit); + return new InputBatch<>(transformDatasetWithQuarantineEvents(datasetInputBatch.getBatch()), Review Comment: Renamed to 'processQuarantineEvents'. Please let me know if it doesn't sound good. -- 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]
