-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
When reading data from tables, for empty request column enforce null or empty
- for collection
- for set
- for map
- for udt
- for any scalar
Object fallback = switch (type) {
case LIST -> new ArrayList<>();
case SET -> new LinkedHashSet<>();
case MAP -> new LinkedHashMap<>();
case USERDEFINED -> buildNullUdt(entry.getValue().getDefinition());
default -> null;
};
row.getColumnMap().put(columnName, fallback);
//....
private Map<String, Object> buildNullUdt(TableUserDefinedTypeDefinition definition) {
if (definition == null) return Collections.emptyMap();
Map<String, Object> nullUdt = new HashMap<>();
definition.getFields().keySet().forEach(field -> nullUdt.put(field, null));
return nullUdt;
}Reactions are currently unavailable