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

修复view 中解析配置的schema,columns -》 name的问题 #1825

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,9 @@ private Map<String, Column> parseSchema(String model) {
jsonObject = jsonObject.getJSONObject("columns");
for (String key : jsonObject.keySet()) {
JSONObject item = jsonObject.getJSONObject(key);
String nameString = item.getJSONArray("name").getString(0);
String[] names;
try {
names = JSONObject.parseArray(nameString).toArray(new String[0]);
} catch (JSONException e) {
names = new String[]{nameString};
}
String[] names = item.get("name") instanceof JSONArray
? item.getJSONArray("name").stream().toArray(String[]::new)
: new String[]{item.get("name").toString()};
Column column = Column.of(ValueType.valueOf(item.getString("type")), names);
schema.put(column.columnKey(), column);
}
Expand Down