use of io.crate.metadata.RowCollectExpression in project crate by crate.
the class RowCollectNestedObjectExpression method value.
@Override
public Map<String, Object> value() {
Map<String, Object> map = new HashMap<>(childImplementations.size());
for (Map.Entry<String, ReferenceImplementation> e : childImplementations.entrySet()) {
ReferenceImplementation referenceImplementation = e.getValue();
if (referenceImplementation instanceof RowCollectExpression) {
//noinspection unchecked
((RowCollectExpression) referenceImplementation).setNextRow(this.row);
}
Object value = referenceImplementation.value();
// as we do not want to convert them when building the response
if (value instanceof BytesRef) {
value = ((BytesRef) value).utf8ToString();
}
map.put(e.getKey(), value);
}
return Collections.unmodifiableMap(map);
}
Aggregations