diff --git a/src/main/java/com/starrocks/connector/flink/row/sink/StarRocksTableRowTransformer.java b/src/main/java/com/starrocks/connector/flink/row/sink/StarRocksTableRowTransformer.java index aef0c02b..9fa5f2e7 100644 --- a/src/main/java/com/starrocks/connector/flink/row/sink/StarRocksTableRowTransformer.java +++ b/src/main/java/com/starrocks/connector/flink/row/sink/StarRocksTableRowTransformer.java @@ -130,8 +130,10 @@ private Object typeConvertion(LogicalType type, RowData record, int pos) { } StarRocksDataType starRocksDataType = columns.getOrDefault(columnNames[pos], StarRocksDataType.UNKNOWN); - if ((starRocksDataType == StarRocksDataType.JSON || - starRocksDataType == StarRocksDataType.UNKNOWN) + if (starRocksDataType == StarRocksDataType.UNKNOWN) { + return sValue; + } + if ((starRocksDataType == StarRocksDataType.JSON) && (sValue.charAt(0) == '{' || sValue.charAt(0) == '[')) { // The json string need to be converted to a json object, and to the json string // again via JSON.toJSONString in StarRocksJsonSerializer#serialize. Otherwise,