apache/druid · error · QueryDriver.RequestError

Field [ ] not found in Protobuf [ ]

Error message

Field [%s] not found in Protobuf [%s]

What it means

ProtobufWriter.writeRowField could not resolve a field descriptor for a result column name: the .proto schema of the response message has no field matching that column. The writer raises a QueryDriver.RequestError (a client-facing error) because the SQL result columns and the declared protobuf schema are out of sync.

Solutions

  1. Compare the .proto definition of the query result message with the SQL query's output columns; align names (case included) and types.
  2. Update the .proto file and regenerate the protobuf classes if the query results changed.
  3. Catch QueryDriver.RequestError at the server layer to return a proper gRPC error status to the client.
  4. Add a schema test that executes representative queries and validates every column maps to a proto field.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/server/ProtobufWriter.java:99 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/37edfe2dbfe50962. Report an issue: GitHub.

Appendix: source

Thrown at extensions-contrib/grpc-query/src/main/java/org/apache/druid/grpc/server/ProtobufWriter.java:99

  @Override
  public void writeRowStart()
  {
    rowBuilder = message.getDefaultInstanceForType().newBuilderForType();
  }

  @Override
  public void writeRowField(String name, @Nullable Object value)
  {
    if (value == null) {
      return;
    }
    final Descriptors.FieldDescriptor fieldDescriptor =
        message.getDescriptorForType().findFieldByName(name);
    // we should throw an exception if fieldDescriptor is null
    // this means the .proto fields don't match returned column names
    if (fieldDescriptor == null) {
      throw new QueryDriver.RequestError(
          "Field [%s] not found in Protobuf [%s]",
          name,
          message.getClass()
      );
    }
    final Method method = methods.computeIfAbsent("setField", k -> {
      try {
        return rowBuilder
            .getClass()
            .getMethod(
                "setField", new Class<?>[]{Descriptors.FieldDescriptor.class, Object.class});
      }
      catch (NoSuchMethodException e) {
        throw new RuntimeException(e);
      }
    });
    try {
      method.invoke(rowBuilder, fieldDescriptor, value);

View on GitHub (pinned to 9b90983fd2)