apache/beam · error · RuntimeException
please provide a parameters function
Error message
please provide a parameters function
What it means
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.
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.
Example fix
// before
writeUnwindBuilder.expand(p) // missing parameters fn
// after
writeUnwindBuilder.withParametersFunction(row -> Collections.singletonMap("name", row.get("name"))).expand(p) Defensive patterns
Strategy: validation
Validate before calling
if (writeSpec.getParametersFunction() == null) throw new IllegalStateException("Call .withParametersFunction() before expand()"); Prevention
- 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.
When it happens
Trigger: Expanding writeUnwind without .withParametersFunction(...); it is mandatory for writes (reads default to an empty map).
Common situations: Reusing read-builder code for writes; refactors dropping the call; forgetting per-row parameter mapping.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- please provide a row mapper
- Error mapping Neo4J result
- Error writing " + unwindList.size() + " rows to Neo4j with…
- neo4j session was not initialized correctly
- null driver given by driver provider
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/f3068521a490c98a.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java:1033
checkArgument(cypher != null, "please provide an unwind cypher statement to execute");
final String unwindMapName = getProvidedValue(getUnwindMapName());
checkArgument(unwindMapName != null, "please provide an unwind map name");
Long batchSize = getProvidedValue(getBatchSize());
if (batchSize == null || batchSize <= 0) {
batchSize = 5000L;
}
Boolean logCypher = getProvidedValue(getLogCypher());
if (logCypher == null) {
logCypher = Boolean.FALSE;
}
if (driverProviderFn == null) {
throw new RuntimeException("please provide a driver provider");
}
if (parametersFunction == null) {
throw new RuntimeException("please provide a parameters function");
}
WriteUnwindFn<ParameterT> writeFn =
new WriteUnwindFn<>(
driverProviderFn,
sessionConfig,
transactionConfig,
cypher,
parametersFunction,
batchSize,
logCypher,
unwindMapName);
input.apply(ParDo.of(writeFn));
return PDone.in(input.getPipeline());
}
@OverrideView on GitHub (pinned to 12126d8942)