{"record":{"id":"f3068521a490c98a","repo":"apache/beam","slug":"please-provide-a-parameters-function","errorCode":null,"errorMessage":"please provide a parameters function","messagePattern":"please provide a parameters function","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java","lineNumber":1033,"sourceCode":"      checkArgument(cypher != null, \"please provide an unwind cypher statement to execute\");\n      final String unwindMapName = getProvidedValue(getUnwindMapName());\n      checkArgument(unwindMapName != null, \"please provide an unwind map name\");\n\n      Long batchSize = getProvidedValue(getBatchSize());\n      if (batchSize == null || batchSize <= 0) {\n        batchSize = 5000L;\n      }\n\n      Boolean logCypher = getProvidedValue(getLogCypher());\n      if (logCypher == null) {\n        logCypher = Boolean.FALSE;\n      }\n\n      if (driverProviderFn == null) {\n        throw new RuntimeException(\"please provide a driver provider\");\n      }\n      if (parametersFunction == null) {\n        throw new RuntimeException(\"please provide a parameters function\");\n      }\n      WriteUnwindFn<ParameterT> writeFn =\n          new WriteUnwindFn<>(\n              driverProviderFn,\n              sessionConfig,\n              transactionConfig,\n              cypher,\n              parametersFunction,\n              batchSize,\n              logCypher,\n              unwindMapName);\n\n      input.apply(ParDo.of(writeFn));\n\n      return PDone.in(input.getPipeline());\n    }\n\n    @Override","sourceCodeStart":1015,"sourceCodeEnd":1051,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java#L1015-L1051","documentation":"Neo4jIO's write/read spec requires a parameters function mapping each element to Cypher statement parameters. When driverProviderFn or the parameters function is missing at expansion/validation time, this RuntimeException guard fires — without it Neo4jIO cannot bind statement values, so configuration is incomplete and rejected before execution.","triggerScenarios":"Expanding writeUnwind without .withParametersFunction(...); it is mandatory for writes (reads default to an empty map).","commonSituations":"Reusing read-builder code for writes; refactors dropping the call; forgetting per-row parameter mapping.","solutions":["Add .withParametersFunction(element -> paramMap) matching the Cypher $params.","Use identity mapping if elements already are maps.","Validate required builder fields before expand in a helper."],"exampleFix":"// before\nwriteUnwindBuilder.expand(p) // missing parameters fn\n// after\nwriteUnwindBuilder.withParametersFunction(row -> Collections.singletonMap(\"name\", row.get(\"name\"))).expand(p)","handlingStrategy":"validation","validationCode":"if (writeSpec.getParametersFunction() == null) throw new IllegalStateException(\"Call .withParametersFunction() before expand()\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember writes require parametersFunction (reads default it); never copy read config onto writes.","Map parameter keys to the Cypher $placeholders and test the Cypher locally."],"tags":["java","neo4j","apache-beam","missing-required-configuration"],"backgroundTag":"missing-required-argument","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}