File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
cypher-aggregation/src/main/java/org/neo4j/gds/projection Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments