yunqingmoswu commented on code in PR #6688:
URL: https://github.com/apache/inlong/pull/6688#discussion_r1036009305
##########
inlong-sort/sort-connectors/kafka/src/main/java/org/apache/inlong/sort/kafka/table/DynamicKafkaDeserializationSchema.java:
##########
@@ -149,6 +171,35 @@ public void deserialize(ConsumerRecord<byte[], byte[]>
record, Collector<RowData
keyCollector.buffer.clear();
}
+ private void deserializeWithDirtyHandle(byte[] value, DirtyType dirtyType,
+ DeserializationSchema<RowData> deserialization, Collector<RowData>
collector) throws IOException {
+ if (!dirtyOptions.ignoreDirty()) {
+ deserialization.deserialize(value, collector);
+ } else {
+ try {
+ deserialization.deserialize(value, collector);
+ } catch (IOException e) {
+ LOG.warn("deserialize error", e);
+ if (dirtySink != null) {
+ DirtyData.Builder<String> builder = DirtyData.builder();
+ try {
+ builder.setData(new String(value))
+ .setDirtyType(dirtyType)
+ .setLabels(dirtyOptions.getLabels())
+ .setLogTag(dirtyOptions.getLogTag())
+ .setIdentifier(dirtyOptions.getIdentifier());
+ dirtySink.invoke(builder.build());
+ } catch (Exception ex) {
+ if (!dirtyOptions.ignoreSideOutputErrors()) {
+ throw new IOException(ex);
+ }
+ LOG.warn("Dirty sink failed", ex);
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]