Explanation of error "UnsupportedOperationException" when performing GDS procedureJun 18, 2024Knowledge
Article DetailsDetailsHelp DetailsWhen performing a Graph Data Science (GDS) procedure, users may encounter an ERROR message, such as "Failed to invoke procedure `gds.xxxxx.xxxxx`: Caused by: java.lang.UnsupportedOperationException". Below is an example cause and solution where this type of message may be seen.When performing the following GDS procedure "gds.graph.filter", the ERROR message will be seen: neo4j@gdstest> CALL gds.graph.filter( 'g2', 'social-graph', 'n:Book OR (n:Person AND (n.age > 10 AND n.age <= 20))', 'r:READS OR r.since IN [2000.0, 2010.0, 2018.0]' ) YIELD graphName, fromGraphName, nodeCount, relationshipCount; +-----------------------------------------------------------+ | graphName | fromGraphName | nodeCount | relationshipCount | +-----------------------------------------------------------+ Failed to invoke procedure `gds.graph.filter`: Caused by: java.lang.UnsupportedOperationException Check the ERROR in query.log. 2024-01-25 01:47:07.601+0000 ERROR id:29694 - transaction id:26 - 132 ms: (planning: 80, waiting: 0) - 312 B - 1 page hits, 0 page faults - bolt-session bolt neo4j-cypher-shell/v5.12.0 client/192.168.64.9:42712 server/192.168.64.9:7687> gdstest - neo4j - CALL gds.graph.filter( 'g2', 'social-graph', 'n:Book OR (n:Person AND (n.age > 10 AND n.age <= 20))', 'r:READS OR r.since IN [2000.0, 2010.0, 2018.0]' ) YIELD graphName, fromGraphName, nodeCount, relationshipCount - {} - runtime=pipelined - {app: 'cypher-shell_v5.12.0', type: 'user-direct'} - Failed to invoke procedure `gds.graph.filter`: Caused by: java.lang.UnsupportedOperationException Why does this ERROR show up?In this case, the ERROR was caused by using wrong parameters in gds.graph.filter, which means there are usage/syntax issues in performing the procedure. As the procedure "gds.graph.filter" is documented in GDS documentation: A predicate is a combination of expressions. The simplest form of expression is a literal. GDS currently supports the following literals: float literals, e.g., 13.37 integer literals, e.g., 42 boolean literals, i.e., TRUE and FALSE Solution:So in this case, lists type "[2000.0, 2010.0, 2018.0]" and "IN" operator are not supported in the filter condition. Rewrite the GDS query with the correct parameters as "r.since=2000.0 OR r.since=2010.0 OR r.since= 2018.0 " and then perform again. CALL gds.graph.filter( "g2", "social-graph", "n.age > 10 AND n.age <= 25", "r.since=2000.0 OR r.since=2010.0 OR r.since= 2018.0 " ); +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | fromGraphName | nodeFilter | relationshipFilter | graphName | nodeCount | relationshipCount | projectMillis | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | "social-graph" | "n.age > 10 AND n.age <= 25" | "r.since=2000.0 OR r.since=2010.0 OR r.since= 2018.0 " | "g2" | 3 | 3 | 37 | +--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ If similar errors are seen when performing GDS procedures, check the usage and syntax to make sure it is performing with correct syntax. If it is believed that the correct syntax is being used, a support case should be logged for review to determine if the ERROR may also be caused by a product defect.InformationTitleExplanation of error "UnsupportedOperationException" when performing GDS procedureArticle Created Date3/15/2024, 10:54 PMURL Name25542496014227-Explanation-of-error-UnsupportedOperationException-when-performing-GDS-procedureLast Modified Date6/18/2024, 6:56 PM