apache/flink · error · ValidationException
Column
Error message
Column
What it means
During CREATE TABLE schema validation, every RowType field is looked up by name in the proto Descriptor via findFieldByName. If no proto field with that name exists, this ValidationException is thrown naming the column. It fires at DDL time, before any data flows.
Source
Thrown at flink-formats/flink-protobuf/src/main/java/org/apache/flink/formats/protobuf/util/PbSchemaValidationUtils.java:83
validateTypeMatch(descriptor, rowType);
}
/**
* Validate type match of row type.
*
* @param descriptor the {@link Descriptors.Descriptor} of the protobuf object.
* @param rowType the corresponding {@link RowType} to the {@link Descriptors.Descriptor}
*/
private static void validateTypeMatch(Descriptors.Descriptor descriptor, RowType rowType) {
rowType.getFields()
.forEach(
rowField -> {
FieldDescriptor fieldDescriptor =
descriptor.findFieldByName(rowField.getName());
if (null != fieldDescriptor) {
validateTypeMatch(fieldDescriptor, rowField.getType());
} else {
throw new ValidationException(
"Column "
+ rowField.getName()
+ " does not exist in definition of proto class.");
}
});
}
/**
* Validate type match of general type.
*
* @param fd the {@link Descriptors.Descriptor} of the protobuf object.
* @param logicalType the corresponding {@link LogicalType} to the {@link FieldDescriptor}
*/
private static void validateTypeMatch(FieldDescriptor fd, LogicalType logicalType) {
if (!fd.isRepeated()) {
if (fd.getJavaType() != JavaType.MESSAGE) {
// simple type
validateSimpleType(fd, logicalType.getTypeRoot());View on GitHub (pinned to 2f3c205e92)
Solutions
- Rename the DDL column to exactly match the proto field name (proto field names are case-sensitive).
- Remove columns that do not exist in the message, or add them to the .proto and regenerate.
- Use computed columns (AS) or watermarks only on fields that exist; keep metadata columns out of the physical schema.
Example fix
-- before (proto field is order_id) CREATE TABLE t (orderId BIGINT, ...) ... -- after CREATE TABLE t (order_id BIGINT, ...) ...
Defensive patterns
Strategy: validation
Validate before calling
Descriptors.Descriptor d = PbFormatUtils.getDescriptor(className);
for (RowField f : rowType.getFields()) {
if (d.findFieldByName(f.getName()) == null)
throw new ValidationException("No proto field " + f.getName());
} Prevention
- Generate DDLs from the .proto (or vice versa) so names cannot drift.
- Remember proto field lookup is case-sensitive; keep naming style consistent.
When it happens
Trigger: A table column (including computed/metadata columns that survive validation) whose name has no matching field in the protobuf message class; case mismatches; renamed proto fields after regeneration.
Common situations: DDL written from an outdated .proto; column names auto-generated by tools (e.g. camelCase vs snake_case differences); joining schemas from different services.
Related errors
- Unexpected LogicalType:
- The 'protobuf' format is not supported for the 'filesystem'
- Table options do not contain an option key '%s' for discover
- The accumulator object '{name}' was created with two differe
- Failed to create Avro encoder.
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/751e6f63a71798db.
Report an issue: GitHub.