org.neo4j.cypher.ParameterNotFoundException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Experiments show that when using FILTER, which contains expressions with named input parameters, then the input parameters are not recognized. It doesn't matter how we name the parameters: \{1\} or \{startPeriod\}. This query - collection filtering depending on other value - FAILED: {CODE} @Query(" START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l <-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c -[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc RETURN bt.name AS type, LENGTH(FILTER(v IN COLLECT(lc.validFrom) : v >= {1} AND v < {2})) AS numberOfNewLicenses, LENGTH(FILTER(v IN COLLECT(lc.validFrom) : v >= {3} AND v < {2})) AS numberOfTotalLicenses ") {CODE} This query - collection filtering depending on other distintive value - FAILED: {CODE} START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l<-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c-[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc WITH DISTINCT bt.name AS name, COLLECT(lc.validFrom) as lvc RETURN name, lvc AS newLicenseList, LENGTH(FILTER(l IN lvc : l >= {1} AND l < {2})) AS numberOfTotalLicenses") Iterable<LicenseInfo> getDepartmentLicenseInfo(String departmentCode, Long startPeriod, Long endPeriod {CODE} This query - collections based on a constant value - also FAILED: {CODE} START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l<-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c-[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc RETURN '' as name, COLLECT(lc.validFrom) AS newLicenseList, LENGTH(FILTER(l IN COLLECT(lc.validFrom) : l >= {1} AND l < {2})) AS numberOfTotalLicenses {CODE} This query - just filtering - also FAILED: {CODE} START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l<-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c-[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc RETURN LENGTH(FILTER(l IN COLLECT(lc.validFrom) : l >= {1} AND l < {2})) AS newLicenseList, LENGTH(FILTER(l IN COLLECT(lc.validFrom) : l >= {1} AND l < {2})) AS numberOfTotalLicenses {CODE} All failed with the same exception: {CODE} Exception in thread "main" org.neo4j.cypher.ParameterNotFoundException: Expected a parameter named 1 at org.neo4j.cypher.internal.commands.ParameterExpression$$anonfun$compute$3.apply(Expression.scala:262) at org.neo4j.cypher.internal.commands.ParameterExpression$$anonfun$compute$3.apply(Expression.scala:262) ... {CODE} (see my post) This works: {CODE} START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l<-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c-[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc WHERE lc.validFrom >= {1} AND lc.validFrom < {2} RETURN DISTINCT bt.name AS name, COLLECT(lc.validFrom) AS newLicenseList, COUNT(lc.validFrom) AS numberOfTotalLicenses {CODE} Extra work of course will be involved in order to filter the newLicenseList collection. My guess is that FILTER some how doesn't accept name parameters regardless how the collection is built.
    via by Nghia Doan,
  • Experiments show that when using FILTER, which contains expressions with named input parameters, then the input parameters are not recognized. It doesn't matter how we name the parameters: \{1\} or \{startPeriod\}. This query - collection filtering depending on other value - FAILED: {CODE} @Query(" START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l <-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c -[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc RETURN bt.name AS type, LENGTH(FILTER(v IN COLLECT(lc.validFrom) : v >= {1} AND v < {2})) AS numberOfNewLicenses, LENGTH(FILTER(v IN COLLECT(lc.validFrom) : v >= {3} AND v < {2})) AS numberOfTotalLicenses ") {CODE} This query - collection filtering depending on other distintive value - FAILED: {CODE} START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l<-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c-[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc WITH DISTINCT bt.name AS name, COLLECT(lc.validFrom) as lvc RETURN name, lvc AS newLicenseList, LENGTH(FILTER(l IN lvc : l >= {1} AND l < {2})) AS numberOfTotalLicenses") Iterable<LicenseInfo> getDepartmentLicenseInfo(String departmentCode, Long startPeriod, Long endPeriod {CODE} This query - collections based on a constant value - also FAILED: {CODE} START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l<-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c-[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc RETURN '' as name, COLLECT(lc.validFrom) AS newLicenseList, LENGTH(FILTER(l IN COLLECT(lc.validFrom) : l >= {1} AND l < {2})) AS numberOfTotalLicenses {CODE} This query - just filtering - also FAILED: {CODE} START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l<-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c-[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc RETURN LENGTH(FILTER(l IN COLLECT(lc.validFrom) : l >= {1} AND l < {2})) AS newLicenseList, LENGTH(FILTER(l IN COLLECT(lc.validFrom) : l >= {1} AND l < {2})) AS numberOfTotalLicenses {CODE} All failed with the same exception: {CODE} Exception in thread "main" org.neo4j.cypher.ParameterNotFoundException: Expected a parameter named 1 at org.neo4j.cypher.internal.commands.ParameterExpression$$anonfun$compute$3.apply(Expression.scala:262) at org.neo4j.cypher.internal.commands.ParameterExpression$$anonfun$compute$3.apply(Expression.scala:262) ... {CODE} (see my post) This works: {CODE} START d=node:DepartmentCode(code={0}) MATCH d<-[:HAS_PROVINCE_LEVEL|HAS_DISTRICT_LEVEL|HAS_WARD_LEVEL]-l<-[:IN_PROVINCE|IN_DISTRICT|IN_WARD]-a<-[:HAS_COMPANY_ADDRESS]-c-[:HAS_BUSINESS_TYPE]->bt, c-[:HAS_COMPANY_LICENSE]->lc WHERE lc.validFrom >= {1} AND lc.validFrom < {2} RETURN DISTINCT bt.name AS name, COLLECT(lc.validFrom) AS newLicenseList, COUNT(lc.validFrom) AS numberOfTotalLicenses {CODE} Extra work of course will be involved in order to filter the newLicenseList collection. My guess is that FILTER some how doesn't accept name parameters regardless how the collection is built.
    via by Nghia Doan,
    • org.neo4j.cypher.ParameterNotFoundException: Expected a parameter named 1 at org.neo4j.cypher.internal.commands.ParameterExpression$$anonfun$compute$3.apply(Expression.scala:262) at org.neo4j.cypher.internal.commands.ParameterExpression$$anonfun$compute$3.apply(Expression.scala:262)
    No Bugmate found.