apache/beam · error · RuntimeException

please provide a row mapper

Error message

please provide a row mapper

What it means

Neo4jIO's Read transform expand() validates that all required configuration has been set on the builder before wiring up the ReadFn. The rowMapper (a RowMapper<OutputT>) converts each Neo4j Result record into the pipeline's output type; without it the transform cannot produce elements, so it fails fast at graph-construction time with a RuntimeException.

Solutions

  1. Call .withRowMapper(rowMapper) on the Neo4jIO.Read builder before expand(), supplying a lambda that maps org.neo4j.driver.Record to your output type.
  2. If you intended GenericRecord-style output, still provide a mapper that extracts fields from the Record.
  3. Verify the builder variable being expanded is the fully configured one, not a partially built intermediate.

Example fix

// before
Neo4jIO.<String>read().withDriverProviderFn(() -> GraphDatabase.driver(url))
// after
Neo4jIO.<String>read()
  .withDriverProviderFn(() -> GraphDatabase.driver(url))
  .withCypher("MATCH (n:Person) RETURN n.name AS name")
  .withRowMapper(record -> record.get("name").asString())
Defensive patterns

Strategy: validation

Validate before calling

if (readSpec.getRowMapper() == null) throw new IllegalStateException("Call .withRowMapper() before expand()");

Prevention

When it happens

Trigger: Calling Neo4jIO.<T>read() (or readAll) and expanding the transform without having called .withRowMapper(...) on the builder, or explicitly passing null.

Common situations: Copy-pasting a read example that only sets cypher/driverProvider and forgetting the mapper; refactoring that removed the mapper call; building the Read spec dynamically where a conditional branch skipped withRowMapper.

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


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/08fff42917a7a421. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java:593

      if (transactionConfig == null) {
        transactionConfig = TransactionConfig.empty();
      }

      Boolean writeTransaction = getProvidedValue(getWriteTransaction());
      if (writeTransaction == null) {
        writeTransaction = Boolean.FALSE;
      }

      Boolean logCypher = getProvidedValue(getLogCypher());
      if (logCypher == null) {
        logCypher = Boolean.FALSE;
      }

      if (driverProviderFn == null) {
        throw new RuntimeException("please provide a driver provider");
      }
      if (rowMapper == null) {
        throw new RuntimeException("please provide a row mapper");
      }
      if (parametersFunction == null) {
        parametersFunction = t -> Collections.emptyMap();
      }

      ReadFn<ParameterT, OutputT> readFn =
          new ReadFn<>(
              driverProviderFn,
              sessionConfig,
              transactionConfig,
              cypher,
              rowMapper,
              parametersFunction,
              writeTransaction,
              logCypher);

      return getOutputPCollection(input, readFn, getCoder());
    }

View on GitHub (pinned to 12126d8942)