apache/seatunnel · error · HugeGraphConnectorException

HugeGraphConnectorErrorCode.INVALID_GRAPH_SCHEMA

HugeGraphConnectorErrorCode.INVALID_GRAPH_SCHEMA

Error message

Mapping[%s/%s]: Source field '%s' for target property '%s' not found in input row. Available fields: %s

What it means

SchemaManager.createMissingPropertyKeys resolves each target HugeGraph property back to a source row field via the configured field_mapping. When the resolved source field is not a column of the input row (fieldIndex < 0), the connector throws INVALID_GRAPH_SCHEMA listing the available fields, because it cannot populate the required PropertyKey.

Source

Thrown at seatunnel-connectors-v2/connector-hugegraph/src/main/java/org/apache/seatunnel/connectors/seatunnel/hugegraph/utils/SchemaManager.java:240

    private static void removeIdFields(
            Set<String> fields, MappingConfig.SourceTargetConfig sourceTargetConfig) {
        if (sourceTargetConfig != null && sourceTargetConfig.getIdFields() != null) {
            fields.removeAll(sourceTargetConfig.getIdFields());
        }
    }

    private void createMissingPropertyKeys(MappingConfig mapping, Set<String> targetPropertyNames) {
        Map<String, String> fieldMapping = mapping.getFieldMapping();

        for (String targetProp : targetPropertyNames) {
            if (client.getPropertyKeyOrNull(targetProp) != null) {
                continue;
            }

            String sourceField = findSourceField(targetProp, fieldMapping);
            int fieldIndex = findFieldIndex(sourceField);
            if (fieldIndex < 0) {
                throw new HugeGraphConnectorException(
                        HugeGraphConnectorErrorCode.INVALID_GRAPH_SCHEMA,
                        String.format(
                                "Mapping[%s/%s]: Source field '%s' for target property '%s' "
                                        + "not found in input row. Available fields: %s",
                                mapping.getType(),
                                mapping.getLabel(),
                                sourceField,
                                targetProp,
                                getFieldNames()));
            }

            SeaTunnelDataType<?> seaType = rowType.getFieldType(fieldIndex);
            DataType hgType = inferHugeGraphDataType(seaType, mapping, targetProp);
            Cardinality cardinality = inferCardinality(seaType);

            LOG.info(
                    "Mapping[{}/{}]: Auto-creating PropertyKey '{}' with type={}, cardinality={}",
                    mapping.getType(),

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Correct field_mapping so every target property maps to an existing source field (compare against the 'Available fields' list in the message).
  2. Add the missing column upstream or via a Transform (e.g. SQL/FieldMapper) before the HugeGraph sink.
  3. Remove the field_mapping entry for properties you do not intend to write.
  4. Check case sensitivity: SeaTunnel row field names must match exactly.

Example fix

// before
field_mapping = {
  user_name = "name"
}
// after (source row has column 'username')
field_mapping = {
  username = "name"
}
Defensive patterns

Strategy: validation

Validate before calling

// Verify every field_mapping source field exists in the SeaTunnel row type
Set<String> rowFields = catalogTable.getTableSchema()
    .getFieldNames().stream().collect(Collectors.toSet());
for (String sourceField : fieldMapping.keySet()) {
  if (!rowFields.contains(sourceField)) {
    throw new IllegalArgumentException("Mapped source field not in row: " + sourceField
        + "; available: " + rowFields);
  }
}

Try / catch

try {
  sink.write(row);
} catch (HugeGraphConnectorException e) {
  if (e.getMessage() != null && e.getMessage().startsWith("Mapping[")) {
    log.error("Field mapping references a missing column: {}", e.getMessage());
  }
  throw e;
}

Prevention

When it happens

Trigger: ensureSchema runs with a mapping whose field_mapping refers to a source field name that does not exist in the incoming SeaTunnel row (typo, wrong case, column removed upstream, or target property name not present in the row when mapping is empty).

Common situations: Rename of an upstream column without updating field_mapping; copy-pasted mapping config from another job; catalog column filtering (e.g. Transform Drop) removing the mapped field before the sink.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/100c7412a111b700. Report an issue: GitHub.