diff --git a/seatunnel-formats/seatunnel-format-text/src/main/java/org/apache/seatunnel/format/text/TextDeserializationSchema.java b/seatunnel-formats/seatunnel-format-text/src/main/java/org/apache/seatunnel/format/text/TextDeserializationSchema.java index 365bcf8faf0..d2ddc37f3d8 100644 --- a/seatunnel-formats/seatunnel-format-text/src/main/java/org/apache/seatunnel/format/text/TextDeserializationSchema.java +++ b/seatunnel-formats/seatunnel-format-text/src/main/java/org/apache/seatunnel/format/text/TextDeserializationSchema.java @@ -73,7 +73,8 @@ public static class Builder { DateTimeUtils.Formatter.YYYY_MM_DD_HH_MM_SS; private TimeUtils.Formatter timeFormatter = TimeUtils.Formatter.HH_MM_SS; - private Builder() {} + private Builder() { + } public Builder seaTunnelRowType(SeaTunnelRowType seaTunnelRowType) { this.seaTunnelRowType = seaTunnelRowType; @@ -186,10 +187,10 @@ private Object convert(String field, SeaTunnelDataType fieldType, int level) LinkedHashMap objectMap = new LinkedHashMap<>(); String[] kvs = field.split(separators[level + 1]); for (String kv : kvs) { - if (kvs.length < 2) { - return null; + String[] splits = kv.split(separators[level + 2]); + if (splits.length < 2) { + objectMap.put(convert(splits[0], keyType, level + 1), null); } else { - String[] splits = kv.split(separators[level + 2]); objectMap.put( convert(splits[0], keyType, level + 1), convert(splits[1], valueType, level + 1));