Skip to content

Commit 986443a

Browse files
committed
Allow passing cloudLocation in remote projection
1 parent f18f28e commit 986443a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

cypher-aggregation/src/main/java/org/neo4j/gds/projection/ValueMapWrapper.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,28 @@ public T mapSequence(SequenceValue value) {
187187

188188
}
189189

190+
@Override
191+
public T mapMap(MapValue value) {
192+
if (MapValue.class.isAssignableFrom(expectedType)) {
193+
return (T) value;
194+
}
195+
196+
if (Map.class.isAssignableFrom(expectedType)) {
197+
var length = value.size();
198+
var javaMap = new HashMap<>(length);
199+
value.foreach((k, v) -> javaMap.put(k, v.map(AsJavaObject.instance())));
200+
return expectedType.cast(javaMap);
201+
}
202+
203+
String message = String.format(
204+
Locale.ENGLISH,
205+
"The value of `%s` must be of type `%s` but was `Map`.",
206+
key,
207+
expectedType.getSimpleName()
208+
);
209+
throw new IllegalArgumentException(message);
210+
}
211+
190212
@Override
191213
public T unsupported(AnyValue value) {
192214
if (expectedType == Object.class && value instanceof Value) {

0 commit comments

Comments
 (0)