This is an automated email from the ASF dual-hosted git repository.
diwu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-kafka-connector.git
The following commit(s) were added to refs/heads/master by this push:
new 1a8d34a [fix] fix Enum data type mapping null pointer (#21)
1a8d34a is described below
commit 1a8d34a76702387365580a04ae970c841ba20518
Author: Petrichor <[email protected]>
AuthorDate: Tue May 28 14:14:08 2024 +0800
[fix] fix Enum data type mapping null pointer (#21)
---
.../apache/doris/kafka/connector/converter/RecordDescriptor.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git
a/src/main/java/org/apache/doris/kafka/connector/converter/RecordDescriptor.java
b/src/main/java/org/apache/doris/kafka/connector/converter/RecordDescriptor.java
index c4f7243..47c34b2 100644
---
a/src/main/java/org/apache/doris/kafka/connector/converter/RecordDescriptor.java
+++
b/src/main/java/org/apache/doris/kafka/connector/converter/RecordDescriptor.java
@@ -134,9 +134,12 @@ public class RecordDescriptor {
this.schemaName = schema.name();
this.schemaTypeName = schema.type().name();
this.type =
- Objects.nonNull(schema.name())
- ? typeRegistry.get(schema.name())
- : typeRegistry.get(schema.type().name());
+ typeRegistry.getOrDefault(
+ schema.name(),
typeRegistry.get(schema.type().name()));
+ if (this.type == null) {
+ throw new IllegalArgumentException(
+ "Type not found in registry for schema: " + schema);
+ }
this.typeName = type.getTypeName(schema);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]