Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
XiaoYou201 opened this issue Jul 5, 2024 · 0 comments · May be fixed by #370
Open

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

XiaoYou201 opened this issue Jul 5, 2024 · 0 comments · May be fixed by #370

Comments

@XiaoYou201
Copy link

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.

XiaoYou201 pushed a commit to XiaoYou201/starrocks-connector-for-apache-flink that referenced this issue Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant