Skip to content

[Bug] The starrocks connector unknown datatype handle method maybe need to change #369

@XiaoYou201

Description

@XiaoYou201

The starrocks connector handle UNKNOWN data type as same as json. It is unreasonable. So, it need to be modified.

case VARCHAR:
String sValue = record.getString(pos).toString();
if (columns == null) {
return sValue;
}
StarRocksDataType starRocksDataType =
columns.getOrDefault(columnNames[pos], StarRocksDataType.UNKNOWN);
if ((starRocksDataType == StarRocksDataType.JSON ||
starRocksDataType == StarRocksDataType.UNKNOWN)
&& (sValue.charAt(0) == '{' || sValue.charAt(0) == '[')) {

In my opinion, if data type is unknown, we should return origin data.

For example, while starrocks table not has a column named c1, but the user insert data has c1 and c1 value is ""(blank string) through flink, it will encounter IndexOfRangeException.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions